Closed Bug 356133 Opened 18 years ago Closed 17 years ago

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

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Assigned: crowderbt)

References

Details

(Keywords: testcase)

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: general → crowder
Status: NEW → ASSIGNED
OS: Mac OS X 10.4 → All
Hardware: Macintosh → All
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
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
WFM, probably fixed by one of Crowder's patches.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite?
Resolution: --- → WORKSFORME
added test as part of js1_5/decompilation/regress-356083.js
Flags: in-testsuite? → in-testsuite+
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
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.