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: throw when async() call param is object with assignement #13410

Conversation

tony-go
Copy link
Contributor

@tony-go tony-go commented Jun 2, 2021

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

Hi there 👋 ,

After few hours exploring babel-parser I open this draft pull request.

Let me know what do you think about the code.

Input code:

async({ foo33 = 1 });

Before: was parsed without error 🤮
After: throw an error as expected 🎉

Note: I got an error running all tests

But it seems to be there even on main branch .

FAIL  packages/babel-node/test/fixtures.js (72.567 s)
  ● bin/babel-node › node_--inspect
thrown: “Exceeded timeout of 20000 ms for a test.
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.”
      206 |     }
      207 |
    > 208 |     it(testName, buildTest(testName, opts), 20000);
          |     ^
      209 |   });
      210 | });

@babel-bot
Copy link
Collaborator

babel-bot commented Jun 2, 2021

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 2, 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 1183a3c:

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

@nicolo-ribaudo nicolo-ribaudo added pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Jun 2, 2021
@tony-go tony-go marked this pull request as ready for review June 2, 2021 18:33
Copy link
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!

@tony-go tony-go requested a review from JLHwung June 3, 2021 13:50
@nicolo-ribaudo nicolo-ribaudo changed the title fix(babel-parser): throw when async call contains object with assignement fix: throw when async() call param is object with assignement Jun 3, 2021
@nicolo-ribaudo nicolo-ribaudo merged commit a0369fd into babel:main Jun 3, 2021
fisker added a commit to prettier/prettier that referenced this pull request Jun 13, 2021
fisker added a commit to prettier/prettier that referenced this pull request Jun 13, 2021
@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 Sep 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: async({ foo33 = 1 }) is parsed without errors
4 participants