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

RESOLVED WORKSFORME

Status

()

--
minor
RESOLVED WORKSFORME
12 years ago
7 years ago

People

(Reporter: jruderman, Unassigned)

Tracking

(Blocks: 1 bug, {testcase})

Trunk
PowerPC
Mac OS X
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

12 years ago
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 []) {
    }
}
(Reporter)

Updated

11 years ago
No longer blocks: 349611
(Reporter)

Updated

11 years ago
Blocks: 349611
(Reporter)

Comment 1

11 years ago
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;})
(Reporter)

Comment 3

7 years ago
Comment 0 looks good now too. WFM :)
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.