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

fix: raise SyntaxError for unparenthesized assert and assign #13099

Merged
merged 2 commits into from Apr 6, 2021

Conversation

fedeci
Copy link
Member

@fedeci fedeci commented Apr 4, 2021

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

Since there is no way to know the previous node we check the contextDescription to have a generic understanding of what it was. However checking that string may lead to errors in the future if the value changes. We may create an enum to store those like is done for Errors.

@babel-bot
Copy link
Collaborator

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 4, 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 258b179:

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

@nicolo-ribaudo nicolo-ribaudo added area: typescript pkg: parser PR: Spec Compliance 👓 A type of pull request used for our changelog categories labels Apr 4, 2021
@nicolo-ribaudo nicolo-ribaudo merged commit 7fe3ebf into babel:main Apr 6, 2021
@fedeci fedeci deleted the fix-13070 branch April 6, 2021 14:10
fisker added a commit to prettier/prettier that referenced this pull request Apr 12, 2021
thorn0 added a commit to prettier/prettier that referenced this pull request Apr 12, 2021
* Build(deps): Bump @babel/parser from 7.13.13 to 7.13.15

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.13.13 to 7.13.15.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.15/packages/babel-parser)

Signed-off-by: dependabot[bot] <support@github.com>

* Add test for babel/babel#13099

* Test babel/babel#13049

* Test babel/babel#13101

* Add long name test

* Style

* Print necessary parens in `{ a: (b as any) = 2000 }`

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
@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 Jul 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Spec Compliance 👓 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript: unparenthesized as in assignment LHS
4 participants