-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
New: Support ES6 classes (refs #10) #67
Conversation
if (allowClasses) { | ||
return parseClassDeclaration(); | ||
} | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading through from the start trying to grok this. If classes are disabled, shouldn't this go to the default
case as with block bindings below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. The default
case and break
ing out of the switch
both end up calling parseStatement()
. Doesn't that make the default
case redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably. I mostly just copy-pasted. :)
espree.js line 2613 in the |
Ah could be! That method was completely refactored in Esprima, and I really didn't want to fight through that refactoring with this commit. |
@btmills That was it! All tests are passing! We have classes! |
New: Support ES6 classes (refs #10)
Three of the original Esprima tests are failing due to a strict mode violation. For some reason, my changes introduced a problem where things like this aren't flagged:
It should throw an error on
eval
, since that's now allowed in strict mode, but doesn't. The three test failures all have to do with this situation (same with getters and methods as well).I've been staring at this for too long and can't figure out how to fix it. Any insights greatly appreciated. :)