-
Notifications
You must be signed in to change notification settings - Fork 472
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
Add cases for Optional Expressions as DestructuringAssignmentTarget #2270
Conversation
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.
Bonkers.
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.
whoops, missed the merge 😄
had a couple questions, mostly me learning the test framework and spec (nothing that would block the merge).
//- elems | ||
[x?.y = 42] | ||
//- vals | ||
[23] |
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.
what purpose does [23]
serve here?
$DONOTEVALUATE(); | ||
var x = {}; | ||
//- elems | ||
[x?.y] |
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.
☝️ does [x.y]
without a RHS evaluate as a destructuring assignment?
I think I would have assumed that this was an [ Expression ]
. Would this production work:
const arr = [x?.y, x?.z];
set y(val) { | ||
throw new Test262Error('The property should not be accessed.'); | ||
} | ||
}?.y] |
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.
same question as above, probably me failing to read this production properly.
@rkirsling I edited your comment to fix the links |
cc @ljharb @bcoe