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

ES spec violation #7993

Closed
user-982634 opened this issue May 21, 2018 · 6 comments · Fixed by #8972
Closed

ES spec violation #7993

user-982634 opened this issue May 21, 2018 · 6 comments · Fixed by #8972
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser

Comments

@user-982634
Copy link

user-982634 commented May 21, 2018

Bug Report

Current Behavior

The parser throws a SyntaxError

Input Code

This is a valid JavaScript code according to the latest ES standard:

a=>{}
/\//

Expected behavior/code

No SyntaxError should be thrown

Babel Configuration (.babelrc, package.json, cli command)

Not sure, I'm using the online babel parser

Possible Solution

’\_(ツ)_/‘

Additional context/Screenshots

@babel-bot
Copy link
Collaborator

Hey @user-982634! 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.

@xtuc
Copy link
Member

xtuc commented Nov 6, 2018

Closing, out of scope for now.

@xtuc xtuc closed this as completed Nov 6, 2018
@nicolo-ribaudo
Copy link
Member

@danez Is this fixed by your context PR?

@danez
Copy link
Member

danez commented Nov 6, 2018

I do not think this is valid. I tried this in acorn, flow, esprima, chrome and node. All parsers fail the same way.

/\//
 ^

SyntaxError: Invalid or unexpected token

@ghost
Copy link

ghost commented Nov 6, 2018

@danez I'm sorry to disapoint you, but this is valid syntax according to the latest EcmaScript specification. I sincerely have no idea how you are testing the script. It works in Chrome, Node.js and Firefox. Probably you concatenated the two lines into single line. The key is that the new line is necessary. Also see this online Node.js interpreter that properly parses this.

@danez
Copy link
Member

danez commented Nov 6, 2018

Ohh, I'm not sure what happened but i was testing this:

a=>[]
/\//

with curly brackets yes it will be fixed with #8972

@danez danez reopened this Nov 6, 2018
@danez danez removed the i: invalid label Nov 6, 2018
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 6, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants