Closed Bug 632029 Opened 13 years ago Closed 13 years ago

Reflect.parse incorrectly optimizes away comprehensions containing `if (false)`

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Unassigned)

References

Details

(Whiteboard: reflect-parse fixed-in-tracemonkey)

js> Reflect.parse('[x for each (x in y) if (false)]', {loc: false}).body[0].expression
({loc:null, type:"ArrayExpression", elements:[]})

This might look like legitimate constant folding. But the difference is
observable if y has any enumerable properties with getters. This is a
surprising bug, since the engine itself does *not* perform this unsound
optimization.
Depends on: 571617
Whiteboard: reflect-parse
This one also appears to just go away with the patch for bug 571617.

Dave
Fixed automatically by fix for bug 571617. Landed a test:

http://hg.mozilla.org/tracemonkey/rev/32093cf27f2e

Dave
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
cdleary-bot mozilla-central merge info:
http://hg.mozilla.org/mozilla-central/rev/32093cf27f2e
Note: not marking as fixed because fixed-in-tracemonkey is not present on the whiteboard.
Resolution: WORKSFORME → FIXED
Whiteboard: reflect-parse → reflect-parse fixed-in-tracemonkey
You need to log in before you can comment on or make changes to this bug.