Incorrect uneval for ({'' setter: function(){}})

VERIFIED FIXED

Status

()

Core
JavaScript Engine
--
minor
VERIFIED FIXED
12 years ago
11 years ago

People

(Reporter: Jesse Ruderman, Assigned: Brian Crowder)

Tracking

({testcase})

Trunk
testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

12 years ago
Split from bug 356083 per crowder -- decompilation of object literals within functions and uneval of objects use completely separate code.

js> o = ({'' setter: function(){}})
[object Object]

js> c = uneval(o)
({set ''() {}})

js> eval(c)
typein:7: SyntaxError: missing : after property id:
typein:7: ({set ''() {}})
typein:7: ......^
(Assignee)

Updated

12 years ago
Assignee: general → crowder
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED
OS: Mac OS X 10.4 → All
Hardware: Macintosh → All
(Assignee)

Comment 1

12 years ago
I think the bug here is that o = ({'' setter: function() {}}) works, but please correct me if I am wrong.
The old setter: syntax (getter:) allows any property id (non-lexical-identifier ids must of course be quoted).  That includes the empty string.  This should still work, so the decompiler should simply produce the old syntax with proper quotes where needed.

/be
(Assignee)

Comment 3

12 years ago
I actually changed my mind about this; I'd like to handle toSource/Decompiler bugs together for cases like this, because I think a future maintainer will be less confused by seeing these changes/fixed go together.  Look at 356083 for the patch coming soon.
Depends on: 356083
(Reporter)

Comment 4

11 years ago
WFM, probably fixed by one of Crowder's patches.
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Flags: in-testsuite?
Resolution: --- → WORKSFORME

Comment 5

11 years ago
added test as part of js1_5/decompilation/regress-356083.js
Flags: in-testsuite? → in-testsuite+
(Assignee)

Comment 6

11 years ago
This is specifically fixed by the patch in bug 356083 (as I mentioned here, I rolled the fixes into one patch.  Thanks for the reminder, Jesse
Resolution: WORKSFORME → FIXED

Comment 7

11 years ago
verified fixed 1.9.0 linux/mac* 2007-05-05
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.