Closed Bug 352453 Opened 18 years ago Closed 17 years ago

Decompilation of (eval)(x)-- does not compile

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9alpha4

People

(Reporter: jruderman, Assigned: brendan)

References

Details

(Keywords: testcase)

Attachments

(1 file)

js> function() { (eval)(x)-- }
function () {
    eval(x)--;
}

js> function () {
    eval(x)--;
typein:3: SyntaxError: invalid decrement operand:

What is special about eval?  If I replace "eval" with, say, "g", the second function is accepted.  I think this is a bug in the compiler rather than a bug in the decompiler.
Yes, eval is recognized by the compiler and a special bytecode, JSOP_EVAL, is selected, so that we can detect indirect eval calls.

I'm not going to worry about this for js1.7/mozilla1.8.1, it's too obscure. The severity is at least minor.

/be
Severity: normal → minor
I meant "at most minor". ;-)

/be
Now the first function (with parens around "eval") is also rejected with "invalid decrement operand".  I think this is incorrect (especially because "eval" can have values other than the native function just like "NaN" can), but at least it gets rid of a decompilation inconsistency :)
Attached patch fixSplinter Review
Trivial.

/be
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #260404 - Flags: review?(mrbkap)
Blocks: js1.7src
OS: Mac OS X → All
Priority: -- → P2
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.9alpha4
Attachment #260404 - Flags: review?(mrbkap) → review+
Fixed on trunk:

js/src/jsparse.c 3.274

/be
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
/cvsroot/mozilla/js/tests/js1_5/decompilation/regress-352453.js,v  <--  regress-352453.js
initial revision: 1.1
Flags: in-testsuite+
verified fixed linux, windows, mac* shell 20070406
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: