Closed Bug 352011 Opened 14 years ago Closed 14 years ago

Decompilation needs to include parens for statements that begins with object literals

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: jruderman, Assigned: brendan)

References

(Blocks 1 open bug)

Details

(Keywords: testcase)

Attachments

(1 file)

js> function() { ({}.y = i); }
function () {
    {}.y = i;
}
Attached patch fixSplinter Review
This is a more general fix to the fix for bug 351625.

/be
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #237587 - Flags: review?(mrbkap)
OS: Mac OS X 10.4 → All
Priority: -- → P1
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.8.1
*** Bug 352017 has been marked as a duplicate of this bug. ***
With this patch, an object literal in a "let" expression decompiles incorrectly.

./js -v 170

js> function() { let(x) ({t:x}) }
function () {
    let (x) {t:x};
}
Another example, similar to comment 3 but with the original parens around more code:

./js -v 170

js> function() { (let(x) {y: z}) }
function () {
    let (x) {y:z};
}

It's interesting that parens can be added in two places (around the object literal, or around the let block) to achieve the same result: making it be a let expression instead of a let block.
Fixed by patch for bug 352026.

/be
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Depends on: 352026
Resolution: --- → FIXED
Checking in regress-352011.js;
/cvsroot/mozilla/js/tests/js1_7/block/regress-352011.js,v  <--  regress-352011.js
initial revision: 1.1
done
Flags: in-testsuite+
verified fixed 1.9 20060914 windows/mac*/linux
bug not evident in 1.8...
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.