Closed Bug 352786 Opened 18 years ago Closed 17 years ago

Round-trip bracing change for "{ if(0) let x; }"

Categories

(Core :: JavaScript Engine, defect)

PowerPC
macOS
defect
Not set
minor

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Unassigned)

References

Details

(Keywords: testcase)

The entire if block is removed because the condition is always false, but the braces stick around for the phantom "let" declaration.

js> function() { { if(0) let x; } }
function () {
    {
    }
}

js> function () {
    {
    }
}
function () {
}
Wait... the "let" shouldn't disappear entirely!  Its scope (currently?) goes beyond the "if" so it needs to stick around.

js> function( ){ if (false) let x }
function () {
}
Depends on: 408957
Fixed by making let |not| directly inside a block be a syntax error (bug 408957).
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
/cvsroot/mozilla/js/tests/public-failures.txt
new revision: 1.23; previous revision: 1.22

/cvsroot/mozilla/js/tests/js1_7/block/regress-352786.js
initial revision: 1.1
Flags: in-testsuite+
Flags: in-litmus-
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.