-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Restore early SyntaxError for strict mode assignment to eval/arguments #1132
Conversation
spec.html
Outdated
@@ -14451,13 +14457,19 @@ <h1>Static Semantics: Early Errors</h1> | |||
It is a Syntax Error if |LeftHandSideExpression| is either an |ObjectLiteral| or an |ArrayLiteral| and |LeftHandSideExpression| is not covering an |AssignmentPattern|. | |||
</li> | |||
<li> | |||
It is an early Reference Error if |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral| and IsValidSimpleAssignmentTarget of |LeftHandSideExpression| is *false*. | |||
It is an early Reference Error if |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral| and IsValidSimpleAssignmentTarget of |LeftHandSideExpression| is ~invalid~. |
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 seems strange to have something named as a predicate (IsValidSimpleAssignmentTarget) not be a boolean. Should this be renamed to something else?
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.
SimpleAssignmentTarget
, AssignmentTarget{Type,Hint}
should do the trick or whatever @anba decides works for me as well.
For anything else, this PR LGTM. +1
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.
AssignTargetType: +1
Thanks for following up on this old issue and helping us get aligned with web reality. LGTM, seems like an accurate fix of the linked bug. Test262 tests would be great. |
Already covered by:
|
OK, it seems like this was an accidental change vs previous versions, corresponds to implementation consensus and tests, and simply restores things from before the typo. I think we should consider this patch ready to land. |
spec.html
Outdated
@@ -13064,7 +13064,10 @@ <h1>Static Semantics: Early Errors</h1> | |||
</emu-grammar> | |||
<ul> | |||
<li> | |||
It is an early Reference Error if IsValidSimpleAssignmentTarget of |LeftHandSideExpression| is *false*. | |||
It is an early Reference Error if IsValidSimpleAssignmentTarget of |LeftHandSideExpression| is ~invalid~. |
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.
This still needs to be renamed to not have an “is” prefix` on an enum
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.
in the editor's call, we decided to rename this to "AssignmentTargetType". I'll take care of this as part of the rebase and merge.
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.
should change name, otherwise +1
2272bfb
to
02f414c
Compare
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.
I've updated the name, as well as all the relevant section names and their IDs, and preserved the oldids
.
It is an early Reference Error if AssignmentTargetType of |UnaryExpression| is ~invalid~. | ||
</li> | ||
<li> | ||
It is an early Syntax Error if AssignmentTargetType of |LeftHandSideExpression| is ~strict~. |
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.
See #1423.
Fixes https://bugs.ecmascript.org/show_bug.cgi?id=4375
Closes #1267.