Closed
Bug 347593
Opened 18 years ago
Closed 18 years ago
For-each loop with destructuring assignment is performed as for loop
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.8.1beta2
People
(Reporter: nanto, Assigned: brendan)
Details
(Keywords: verified1.8.1)
Attachments
(1 file)
1.89 KB,
patch
|
igor
:
review+
mrbkap
:
superreview+
beltzner
:
approval1.8.1+
|
Details | Diff | Splinter Review |
If destructuring assignment is used in for-each loop, the loop incorrectly iterates over the object as if it is for loop. js> for (let [, { a: b }] in [{ a: 2 }, { a: 3 }]) print(b); // OK 2 3 js> for each (let { a: b } in [{ a: 2 }, { a: 3 }]) print(b); // Wrong undefined undefined js> for each (let [, { a: b }] in [{ a: 2 }, { a: 3 }]) print(b); // Wrong 2 3 In the example above, the second loop should show 2 and 3 and the third loop should throw a TypeError exception.
Assignee | ||
Comment 2•18 years ago
|
||
Small fix to get js1.7 semantics right regarding for (i in o) vs. for each (v in o) key (identifier) vs. property value enumeration, in combination with the new destructuring assignment support (for ([k,v] in o) to destructure key-value pairs vs. for each ({vp1:x, vp2:y} in o) to destructure properties of the value, vp1 and vp2 in this example). /be
Attachment #232582 -
Flags: superreview?(mrbkap)
Attachment #232582 -
Flags: review?(igor.bukanov)
Attachment #232582 -
Flags: approval1.8.1?
Assignee | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
OS: Windows XP → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.8.1beta2
Updated•18 years ago
|
Attachment #232582 -
Flags: review?(igor.bukanov) → review+
Assignee | ||
Comment 3•18 years ago
|
||
Fixed on trunk. /be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: blocking1.8.1?
Resolution: --- → FIXED
Comment 4•18 years ago
|
||
Checking in regress-347593.js; /cvsroot/mozilla/js/tests/js1_7/geniter/regress-347593.js,v <-- regress-347593.js initial revision: 1.1
Flags: in-testsuite+
Comment 5•18 years ago
|
||
Comment on attachment 232582 [details] [diff] [review] fix a=drivers
Attachment #232582 -
Flags: approval1.8.1? → approval1.8.1+
Assignee | ||
Comment 6•18 years ago
|
||
Fixed on the 1.8 branch too. /be
Flags: blocking1.8.1?
Keywords: fixed1.8.1
Updated•18 years ago
|
Attachment #232582 -
Flags: superreview?(mrbkap) → superreview+
Comment 7•18 years ago
|
||
verified fixed 1.9 win/mac(ppc|tel)/linux 20060808
Status: RESOLVED → VERIFIED
Comment 8•18 years ago
|
||
verified fixed 1.8 20060809 mac(ppc|tel)/linux. Unfortunately I don't have windows test results for 20060809 1.8, but verifying anyway.
Keywords: fixed1.8.1 → verified1.8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•