Closed
Bug 410981
Opened 17 years ago
Closed 17 years ago
js1_7/decompilation/regress-356247.js - for (let) allows let as child without block
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.9beta3
People
(Reporter: bc, Assigned: brendan)
References
Details
Attachments
(1 file, 1 obsolete file)
4.06 KB,
patch
|
brendan
:
review+
brendan
:
approval1.9+
|
Details | Diff | Splinter Review |
js> (function() { for(let x in []) let {} = [1]; })
function () {
for (let x in []) {
let [] = [1];
}
}
Flags: in-testsuite+
Flags: in-litmus-
Assignee | ||
Updated•17 years ago
|
Priority: -- → P1
Target Milestone: --- → mozilla1.9 M11
Assignee | ||
Updated•17 years ago
|
Status: NEW → ASSIGNED
Flags: blocking1.9+
Hardware: PC → All
Assignee | ||
Comment 1•17 years ago
|
||
Of course, this exists only given 'for (let x...)' and equivalent let bindings in for loop initial parts, and for-in loop left-hand sides. Such bindings make a block scope around the loop body (and condition and update parts, if for rather than for-in). This means the decompilation is not accurate, but it does not mean the for loop's enclosing scope is polluted by the let in the body. E.g., in
for (let x in [1,2,3]) let y = x*x
y does not escape the loop body's implicit block scope.
/be
Assignee | ||
Comment 2•17 years ago
|
||
Attachment #295586 -
Flags: review?(mrbkap)
Updated•17 years ago
|
Attachment #295586 -
Flags: review?(mrbkap) → review+
Comment on attachment 295586 [details] [diff] [review]
fix
@@ -3194,17 +3195,18 @@ Statement(JSContext *cx, JSTokenStream *
the comment described what the old if did, afaict it no longer describes the current logic.
Assignee | ||
Comment 4•17 years ago
|
||
Thanks, timeless!
/be
Attachment #295586 -
Attachment is obsolete: true
Attachment #295744 -
Flags: review+
Attachment #295744 -
Flags: approval1.9+
Assignee | ||
Comment 5•17 years ago
|
||
Fixed:
js/src/jsemit.h 3.88
js/src/jsparse.c 3.322
/be
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 6•17 years ago
|
||
The following also required updating now that this is fixed.
/cvsroot/mozilla/js/tests/js1_7/extensions/regress-346642-06.js,v
new revision: 1.4; previous revision: 1.3
You need to log in
before you can comment on or make changes to this bug.
Description
•