Closed
Bug 352921
Opened 19 years ago
Closed 12 years ago
Label misplaced after hoisting with "L: for(var i = x in w)"
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Unassigned)
Details
(Keywords: testcase)
js> function() { L: for(let i = x in w) break L }
function () {
L:
x;
for (let i in w) {
break L;
}
}
(Is this the only construct that causes a statement to be hoisted, or are there others?)
| Reporter | ||
Comment 1•19 years ago
|
||
The problem is more clear with "continue" than "break", because you can only continue to a loop.
Comment 2•19 years ago
|
||
Yes, only in the bizarre case of an initializer for a for-in variable do we hoist the initalizer (and the var; let must remain in the loop of course), to simplify the source annotations needed for decompilation.
This is a minor bug.
/be
Severity: normal → minor
| Reporter | ||
Comment 3•19 years ago
|
||
Something similar happens with |var|:
js> function() { L: for(var i = x in w) break L }
function () {
L:
var i = x;
for (i in w) {
break L;
}
}
Comment 4•14 years ago
|
||
Comment #0 now gives:
js> (function() { L: for(let i = x in w) break L })
typein:23: SyntaxError: for-in loop let declaration may not have an initializer:
typein:23: (function() { L: for(let i = x in w) break L })
typein:23: .........................^
Comment #3 still shows the bug.
OS: Mac OS X → All
Hardware: PowerPC → All
Comment 5•14 years ago
|
||
BytecodeEmitter.cpp: "'for (let x = i in o)' is mercifully banned."
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
| Reporter | ||
Updated•14 years ago
|
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Summary: Label misplaced after hoisting with "L: for(let i = x in w)" → Label misplaced after hoisting with "L: for(var i = x in w)"
Comment 6•12 years ago
|
||
Fixed by saving the source (bug 761723).
Status: REOPENED → RESOLVED
Closed: 14 years ago → 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•