Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly disambiguate / after async fuctions #10475

Merged
merged 3 commits into from Dec 2, 2019

Conversation

nicolo-ribaudo
Copy link
Member

Q                       A
Fixed Issues? Fixes #10410
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

@nicolo-ribaudo nicolo-ribaudo added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: parser Spec: Async Functions labels Sep 21, 2019
@babel-bot
Copy link
Collaborator

babel-bot commented Sep 21, 2019

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11705/

// It's easier and more efficient to adjust the context here.
throw new Error("Internal error");
}
this.state.context.push(tc.functionExpression);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be more efficient to check the last element of this.state.context and simply replace it with tc.functionExpression without push and pop.

@@ -19,6 +19,7 @@
// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser

import { types as tt, type TokenType } from "../tokenizer/types";
import { types as tc } from "../tokenizer/context";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: prefer ct to be consistent with naming in tokenizer.

nicolo-ribaudo and others added 2 commits September 25, 2019 01:56
Co-Authored-By: Huáng Jùnliàng <i@jhuang.me>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Async Functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[parser] Regex on new line after typeof async function is division
3 participants