Skip to content

Fix regression with let #9477

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

Merged
merged 4 commits into from
Feb 8, 2019
Merged

Fix regression with let #9477

merged 4 commits into from
Feb 8, 2019

Conversation

danez
Copy link
Member

@danez danez commented Feb 8, 2019

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

This fixes the regression in 3.7.2 with let in certain cases and also allows a lot more new valid cases with functions (see test262 whitelist). This was backported from my branch which includes proper scope tracking. This is also the reason I did not care about good error messages here, as the code involving them will change anyway.

@danez danez added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: parser labels Feb 8, 2019
@babel-bot
Copy link
Collaborator

babel-bot commented Feb 8, 2019

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

@babel-bot
Copy link
Collaborator

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

case tt._class:
if (!declaration) this.unexpected();
if (context) this.unexpected();
Copy link
Member

Choose a reason for hiding this comment

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

As a side note, Function declaration is not allowed in this context is much nicer 😄

Copy link
Member

@existentialism existentialism left a comment

Choose a reason for hiding this comment

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

👍

@danez danez merged commit 2817844 into babel:master Feb 8, 2019
@danez danez deleted the fix-let branch February 8, 2019 21:36
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 2019
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: Babel 7.3.2 fails to parse let statements with object destructuring after a line break
4 participants