Closed Bug 353017 Opened 18 years ago Closed 13 years ago

Round-trip change with if(0) function declaration, var of the same name

Categories

(Core :: JavaScript Engine, defect)

PowerPC
macOS
defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

js> h = (function() { for(var x in []) { x; } if(0) function x() { } })
function () {
    for (var x in []) {
        x;
    }
}

js> eval(""+h)
function () {
    for (var x in []) {
    }
}
Here's a clearer testcase:

js> f = (function() { var x; if(0) { function x() {} } x; })
function () {
    var x;
    x;
}
js> eval("(" + f + ")")
function () {
    var x;
}

I get the same output for both cases now in comment #1.
js> f = (function() { var x; if(0) { function x() {} } x; })
(function () {var x;})
js> eval("(" + f + ")")
(function () {var x;})
Comment 0 looks good now too. WFM :)
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.