Closed Bug 504957 Opened 16 years ago Closed 14 years ago

Assignment-to-const is not removed with rhs of "a.@b::c"

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

js> f = (function x() { x = a.@b::c; }); function x() { x = a.@[b::c]; } js> eval(uneval(f)); function x() { a.@[b::c]; } Gary found this bug (the round-trip change tripped jsfunfuzz).
This doesn't seem to happen anymore. Anyway, it would be a bug to remove the rhs since it can throw (if a is undefined, for example).
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Here's what happens now: js> f = (function x() { x = a.@b::c; }); (function x() {x = a.@[b::c];}) js> eval(uneval(f)); (function x() {x = a.@[b::c];}) I think the "remove assignment to const" optimization no longer kicks in when it's an assignment to the name of the function. In contrast, assigning to a local const does get removed. js> f = (function () { const x; x = a.@b::c; }); (function () {const x;a.@[b::c];}) The round-trip problem seems to be gone in all cases :)
You need to log in before you can comment on or make changes to this bug.