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

Error for "missing argument in class setters" fails to format #98

Closed
Marsup opened this issue Mar 19, 2015 · 0 comments
Closed

Error for "missing argument in class setters" fails to format #98

Marsup opened this issue Mar 19, 2015 · 0 comments

Comments

@Marsup
Copy link
Contributor

Marsup commented Mar 19, 2015

Using espree master, this code :

espree.parse('class A { set foo(){} }', { ecmaFeatures: { classes: true }});

Throws :

Error: ASSERT: Message reference must be in range
    at assert (/home/ubuntu/workspace/espree.js:78:15)
    at /home/ubuntu/workspace/espree.js:2083:17
    at String.replace (native)
    at throwError (/home/ubuntu/workspace/espree.js:2080:29)
    at throwErrorTolerant (/home/ubuntu/workspace/espree.js:2106:20)
    at tryParseMethodDefinition (/home/ubuntu/workspace/espree.js:2438:17)
    at parseClassBody (/home/ubuntu/workspace/espree.js:4984:22)
    at parseClassDeclaration (/home/ubuntu/workspace/espree.js:5065:17)
    at parseSourceElement (/home/ubuntu/workspace/espree.js:5095:28)
    at parseSourceElements (/home/ubuntu/workspace/espree.js:5143:25)

I think tryParseMethodDefinition L2438 should be throwErrorTolerant(lookahead, Messages.UnexpectedToken, lookahead.value);

@nzakas nzakas closed this as completed in 03b1fa4 Mar 21, 2015
nzakas added a commit that referenced this issue Mar 21, 2015
Fix: bad error in parsing invalid class setter (fixes #98)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants