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

[Parser]: First token after a class is considered strict mode #11183

Closed
pvdz opened this issue Feb 27, 2020 · 1 comment · Fixed by #11186
Closed

[Parser]: First token after a class is considered strict mode #11183

pvdz opened this issue Feb 27, 2020 · 1 comment · Fixed by #11186
Assignees
Labels
Has PR i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser

Comments

@pvdz
Copy link

pvdz commented Feb 27, 2020

I guess when parsing the } closing token of a class, the next token is still parsed as the strict-mode context from that class, rather than using the outer strict mode status.

In script mode, this (a legacy octal) passes in Babel (because it applies annexb by default):

05

This fails after a class:

class x {}
05

But passes with anything in between:

class x {}
y
05

(All the above cases should pass in non-strict script mode under annexb rules)

Babel Parser version: 7.8.4

@babel-bot
Copy link
Collaborator

Hey @pvdz! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@kaicataldo kaicataldo self-assigned this Feb 28, 2020
@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 Jun 24, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Has PR i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants