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
Fix await in function name and parameters #7727
Conversation
nicolo-ribaudo
commented
Apr 13, 2018
Q | A |
---|---|
Fixed Issues? | |
Patch: Bug Fix? | y |
Major: Breaking Change? | |
Minor: New Feature? | |
Tests Added + Pass? | Yes |
Documentation PR | |
Any Dependency Changes? | |
License | MIT |
@@ -525,10 +525,15 @@ export default class ExpressionParser extends LValParser { | |||
} | |||
return this.finishNode(node, "MemberExpression"); | |||
} else if (!noCalls && this.match(tt.parenL)) { | |||
const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; | |||
const oldYOAIPAP = this.state.yieldOrAwaitInPossibleArrowParameters; |
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.
Any sugestion for a shorter name than yieldOrAwaitInPossibleArrowParameters
? 😆
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.
None other than Parameters -> Params, but not a huge difference lol
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/9338/ |
@@ -12,6 +12,7 @@ ES6/binding-pattern/object-pattern/await-prop-in-async-function.js | |||
JSX_invalid/migrated_0000.js | |||
arrow_function_invalid/migrated_0002.js | |||
async_await/async_generic_method.js | |||
async_await/migrated_0007.js |
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.
I think that this test is wrong (because of https://tc39.github.io/ecma262/#sec-identifiers-static-semantics-early-errors)
https://github.com/facebook/flow/blob/master/src/parser/test/flow/async_await/migrated_0007.js
c2ee6bc
to
bdf4159
Compare
bdf4159
to
3e1fad3
Compare
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.
Looks good to me. No idea for a way shorter name though.
For reference here are the fixes that acorn did to fix nearly the same things:
acornjs/acorn@7163d84
acornjs/acorn@5ab3d01
FYI: The tests of this PR were put into |
Thank you! |