Closed
Bug 1040699
Opened 12 years ago
Closed 11 years ago
Remove "group assignment" optimization in destructuring assignment
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: Swatinem, Assigned: Swatinem)
References
Details
Attachments
(1 file)
|
12.57 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
From bug 933276 comment 21:
(In reply to Jason Orendorff [:jorendorff] from comment #21)
> Arpad, I just realized it's necessary to delete the "group assignment"
> optimization.
>
> Try this and you'll see what I mean:
>
> js> delete Array.prototype["@@iterator"];
> js> (function () { var [x, y] = [1, 2]; })() // should throw TypeError
> because Array#@@iterator is gone
> js> dis(function () { var [x, y] = [1, 2]; })
>
>
> Fortunately that should be very easy to delete. Please do it in a separate
> patch though, preferably *under* (before) this patch.
Right now, we have a special "group assignment" optimization that is triggered when we have an ArrayPattern on the LHS and an ArrayLiteral on the RHS.
Bug 933276 will move destructuring assignment over to use @@iterator, as specified in ES6, which collides with this optimization.
Removing it and always using the normal destructuring code should make moving to @@iterator a lot easier.
| Assignee | ||
Comment 1•12 years ago
|
||
Attachment #8459138 -
Flags: review?(jorendorff)
Comment 2•12 years ago
|
||
Comment on attachment 8459138 [details] [diff] [review]
Remove "group assignment" optimization in destructuring assignment
Review of attachment 8459138 [details] [diff] [review]:
-----------------------------------------------------------------
Thank you.
Updated•12 years ago
|
Attachment #8459138 -
Flags: review?(jorendorff) → review+
Updated•11 years ago
|
Blocks: es6destructuring
| Assignee | ||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in
before you can comment on or make changes to this bug.
Description
•