Expressions optimized into strings uneval using double-quotes, causing change to single-quotes during round trip

RESOLVED WONTFIX

Status

()

--
minor
RESOLVED WONTFIX
12 years ago
4 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
http://www.squarefree.com/shell/shell.html, Mac trunk nightly.

When round-tripped through the JavaScript engine using uneval and eval, this function is changed from using double quotes to using single quotes.

> function() { [3]["" + ""] }
function () { [3][""]; }

> function() { [3][""] }
function () { [3]['']; }

Here's another example, this time using a different optimization, where it changes from using double quotes to using dot notation:

> function() { [3][0 ? "a" : "b"] }
function () { [3]["b"]; }

> function () { [3]["b"]; }
function () { [3].b; }
This is all allowed by ECMA, and we want to optimize.  So until we switch to source recovery from decompilation, you'll have to round-trip once to bless the function to match its canonical source.  I'm gonna WONTFIX, since this is not exactly INVALID.  With more source annotations, we could decompile what you wrote, but it's not worth it.

/be
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → WONTFIX
(Reporter)

Comment 2

12 years ago
I'm not asking you to "decompile what I wrote"; I'm asking you to use the same notation for optimized expressions as would be used in the same context if the expression had not needed optimization.  Feel free to wontfix again.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
(In reply to comment #2)
> I'm not asking you to "decompile what I wrote"; I'm asking you to use the same
> notation for optimized expressions as would be used in the same context if the
> expression had not needed optimization.

There's no difference in practice.  We always optimize a certain way, or we don't, so either you get what you wrote, or what we optimized.  Not sure why you are reopening just to argue.

> Feel free to wontfix again.

I will!

/be 

Status: REOPENED → RESOLVED
Last Resolved: 12 years ago12 years ago
Resolution: --- → WONTFIX
(Reporter)

Updated

12 years ago
Blocks: 349611
(Reporter)

Updated

12 years ago
Summary: Expressions optimized into strings uneval strangely, causing function to change during round trip → Expressions optimized into strings uneval using double-quotes, causing change to single-quotes during round trip
(Reporter)

Comment 4

10 years ago
FWIW, on the disassembly side, this WONTFIXed bug amounts to the difference between

00006:  string ""
00009:  getelem

and

00006:  getprop ""
See Also: → bug 1143279
You need to log in before you can comment on or make changes to this bug.