Skip to content

Fix issue to allow module block in member expression#13573

Merged
JLHwung merged 8 commits intobabel:mainfrom
nme077:main
Jul 19, 2021
Merged

Fix issue to allow module block in member expression#13573
JLHwung merged 8 commits intobabel:mainfrom
nme077:main

Conversation

@nme077
Copy link
Copy Markdown
Contributor

@nme077 nme077 commented Jul 19, 2021

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

Moved the logic to check for module {} in babel-parser from Parser#parseMaybeUnary to Parser#parseExprAtom within the tt.name token.

@existentialism existentialism added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Jul 19, 2021
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Jul 19, 2021

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

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Jul 19, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1c04552:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

Copy link
Copy Markdown
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

Not a blocker: After this PR, we can further remove the module lookahead. Like how we are handling async function and async x =>, we can parse the module as an id and when we see a left curly brace, we can reuse the id node and then finished as a ModuleExpression.

@nicolo-ribaudo
Copy link
Copy Markdown
Member

Can you delete the package.tgz file? I think you added it by accident.

@JLHwung JLHwung mentioned this pull request Jul 19, 2021
6 tasks
@nme077
Copy link
Copy Markdown
Contributor Author

nme077 commented Jul 19, 2021

@nicolo-ribaudo done. I removed the package.tgz file.

@nme077 nme077 changed the title Fix issue to allow module block in member expression #13533 Fix issue to allow module block in member expression Jul 19, 2021
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

Thanks!

@JLHwung
Copy link
Copy Markdown
Contributor

JLHwung commented Jul 19, 2021

The CI error is unrelated and has been fixed in #13567.

@JLHwung JLHwung merged commit 2c6db56 into babel:main Jul 19, 2021
nicolo-ribaudo pushed a commit to nicolo-ribaudo/babel that referenced this pull request Jul 30, 2021
* Accept module in primaryExpression

* Add module blocks to primaryExpression

* Fix package.json

* Fix yarn.lock

* Fix yarn.lock

* Remove package.tgz file
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 19, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2021
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: Module Expressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Module block should be allowed in member expression

5 participants