-
Notifications
You must be signed in to change notification settings - Fork 334
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
Super class expression parenthesis #404
Super class expression parenthesis #404
Conversation
Sync with escodegen/master
@michaelficarra need your review |
@michaelficarra ping |
escodegen.js
Outdated
@@ -1145,7 +1145,17 @@ | |||
result = join(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT)); | |||
} | |||
if (stmt.superClass) { | |||
fragment = join('extends', this.generateExpression(stmt.superClass, Precedence.Assignment, E_TTT)); | |||
var superClassExpression = this.generateExpression(stmt.superClass, Precedence.Assignment, E_TTT); |
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.
None of the rest of this is necessary. ClassHeritage is a LeftHandSideExpression, not an AssignmentExpression. We should just replace Precedence.Assignment
on this line with Precedence.Unary
.
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.
Will try
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.
It works, thank you
@michaelficarra fixed |
* Added parenthesis for some `superClass` expressions * Simplify logic to enable super class expression parenthesis
Fixes javascript-obfuscator/javascript-obfuscator#326