Decompilation turns function expression into function declaration

VERIFIED FIXED in mozilla1.8.1

Status

()

defect
P1
normal
VERIFIED FIXED
13 years ago
13 years ago

People

(Reporter: jruderman, Assigned: brendan)

Tracking

(Blocks 1 bug, {testcase, verified1.8.1})

Trunk
mozilla1.8.1
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

js> function() { (function x() {  }); return x; }

function () {
    function x() {};
    return x;
}
In the example in comment 0, decompilation changes the meaning of the funciton.   Here's an example where decompilation creates something that doesn't compile:

js> function() {  (function(){} | x) } 

function () {
    function () {} | x;
}
Posted patch fixSplinter Review
As with '{', if an expression statement starts with 'function ', it must be parenthesized.

Note how let (x=y) function(){} is free of this rule, but not let (x=y) ({p:x}).

/be
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #237803 - Flags: review?(mrbkap)
OS: Mac OS X 10.4 → All
Priority: -- → P1
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.8.1
Attachment #237803 - Flags: review?(mrbkap) → review+
Attachment #237803 - Flags: approval1.8.1?
Fixed on trunk.

/be
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment on attachment 237803 [details] [diff] [review]
fix

a=schrep
Attachment #237803 - Flags: approval1.8.1? → approval1.8.1+
Fixed on the 1.8 branch.

/be
Keywords: fixed1.8.1
Checking in regress-352073.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-352073.js,v  <--  regress-352073.js
initial revision: 1.1
done
Flags: in-testsuite+
verified fixed 1.8 20060914 windows/linux 1.9 20060914 windows/mac*/linux
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.