Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Decompiler bug with CONCATN




JavaScript Engine
7 years ago
6 years ago


(Reporter: jorendorff, Assigned: jorendorff)


Other Branch

Firefox Tracking Flags

(status1.9.2 wanted)


(Whiteboard: fixed-in-tracemonkey)


(2 attachments)



7 years ago
js> function f() { return "" + 2 + (i + 1); }
js> f
function f() {return "" + 2 + i + 1;}

Note the subtle change in meaning there.

Comment 1

7 years ago
hasenj, the contributor who originally reported this bug, spent days working with me to reduce it from a complex web application.

The initial bug was simply that the former code was mysteriously behaving like the latter. We suspected the interpreter, the tracer, and ultimately the parser before discovering in a marathon gdb session that the code being handed to the JS compiler was actually subtly different from the script on disk.

hasenj ultimately discovered that the application has module-loading code that takes functions, converts them to strings, and passes the strings back to Function by way of eval, or something.

Comment 2

7 years ago
Created attachment 439109 [details] [diff] [review]
Assignee: general → jorendorff
Attachment #439109 - Flags: review?(shaver)
Comment on attachment 439109 [details] [diff] [review]

My bad, I bet. r=shaver
Attachment #439109 - Flags: review?(shaver) → review+
There's either a decompilation or extensions directory the test should go in, no?
Why do we care?  We always have to search for them that way (else memorize JS and ECMA version history), and people who want to re-use our test suite can filter out whatever they don't want.  This bug affects web content, so they might well want to include it.

Comment 6

7 years ago

Waldo, r=me to move the test wherever you want, if shaver's argument in comment 5 doesn't satisfy you.

The test is a little different from most decompiler tests in that it's directly testing behavior.
Whiteboard: fixed-in-tracemonkey
Asserting that we want to fix this compat bug in the next 3.6 update.
status1.9.2: --- → wanted

Comment 8

7 years ago

Comment 9

7 years ago
(In reply to comment #8)

> +function f(x) { return 1 + "" + (x + 1); }
> +reportCompare("12", f(1), "");
> +var g = eval(String(f));
> +reportCompare("12", f(1), "");
Shouldn’t f(1) on the last line be g(1)?

Comment 10

7 years ago
(In reply to comment #9)
> Shouldn’t f(1) on the last line be g(1)?
Oops, never mind.  Now I see how the test works (the eval redefines the function f).

Comment 11

7 years ago
fcp: You're right. peterv noticed this yesterday too, and I changed the test.

Comment 12

7 years ago
Last Resolved: 7 years ago
Resolution: --- → FIXED


7 years ago
Duplicate of this bug: 620567

Comment 14

7 years ago
Jason, we should probably fix this on 1.9.2...  This is breaking greasemonkey users there, at least, plus whatever web app you were looking at, right?
blocking1.9.2: --- → ?

Comment 15

7 years ago
We'd like to take this for
blocking1.9.2: ? → ---

Comment 16

6 years ago
Created attachment 531312 [details]
Demonstrates some failures

The bug still exists.

I can confirm this error on both 3.6.17 and 4.0.1 (tarball from running on Ubuntu 10.04.

Comment 17

6 years ago
I must have kept open the wrong window, 4.0.1 is fine, only 3.6.17 is affected (and possibly previous versions).
You need to log in before you can comment on or make changes to this bug.