Closed Bug 382502 Opened 17 years ago Closed 13 years ago

Round-trip line-breaking change with genexp

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

This is strange.. there isn't any change to parenthesization, but there's a change to line-breaking.

js> f = function(){ while(t && (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa for (g in b))) {} }
function () {
    while (t &&
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa for (g in b)) {
    }
}

js> eval("(" + f + ")")
function () {
    while (t && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa for (g in b)) {
    }
}
The behavior has changed.

js> f = function(){ while(t && (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa for (g in b))) {} }
(function () {while (t && true) {}})

js> eval("(" + f + ")")
(function () {while (t && true) {}})
That's quite an optimization.

I guess I'll call this bug WFM, and file a new bug if I hit another round-trip line-breaking change.
(In reply to Jesse Ruderman from comment #2)
> That's quite an optimization.
> 
> I guess I'll call this bug WFM, and file a new bug if I hit another
> round-trip line-breaking change.

Yup!
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.