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
Conversation
nicolo-ribaudo
commented
Sep 21, 2019
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 |
24c2c48
to
99523fa
Compare
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); |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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
.
Co-Authored-By: Huáng Jùnliàng <i@jhuang.me>