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

Refactor parseSubscript #10937

Merged
merged 4 commits into from Dec 30, 2019
Merged

Refactor parseSubscript #10937

merged 4 commits into from Dec 30, 2019

Conversation

@JLHwung
Copy link
Contributor

JLHwung commented Dec 29, 2019

Q                       A
Fixed Issues? It happens to fix this REPL invalid case, which should throw.
Patch: Bug Fix? Yes
Tests Added + Pass? Yes
License MIT

I reorganize the process flow in parser.prototype.parseScript, the code is now more succinct. It happens to fix an edge case of flow typecast in optional call params.

Notable changes:

  • The OptionalMemberExpression is generated in a single branch
  • The OptionalCallExpression shares the same extra logic with CallExpression. It fixes the bug by calling toReferencedListDeep, same as CallExpression.

The new process flow is almost copied from acornjs/acorn#891.

Copy link
Member

existentialism left a comment

👍

@JLHwung JLHwung merged commit 30449fe into babel:master Dec 30, 2019
5 checks passed
5 checks passed
build (13.x)
Details
Travis CI - Pull Request Build Passed
Details
build-standalone Workflow: build-standalone
Details
e2e Workflow: e2e
Details
test262 Workflow: test262
Details
@JLHwung JLHwung deleted the JLHwung:refactor-parseSubscript branch Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.