Incorrect uneval trying to output a getter function that is a sharp definition

VERIFIED FIXED

Status

()

VERIFIED FIXED
12 years ago
11 years ago

People

(Reporter: jruderman, Assigned: crowderbt)

Tracking

({testcase})

Trunk
x86
Mac OS X
testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

12 years ago
One of the testcases mentioned in bug 358594 is still not handled correctly:

js> a = {}; h = function() { }; a.b getter = h; a.c = h; uneval(a);
({b getter:#1=() {}, c:#1#})

It's missing the "function" keyword in the anonymous-function expression.

(
Before the patch in bug 358594, the output was even worse: 
({get b #1=() {}, c:#1#})
)
(Assignee)

Comment 1

12 years ago
Created attachment 265048 [details] [diff] [review]
implementation v1

So we need to "sharpen" variables before we start thinking about chopping them up for syntactic reasons.  The sharpen step tells us whether or not we need old-style getter/setters and so prevents us mistakenly slicing "(function " off of "#1#", since we never do that hackery with old-style getter/setter.
Assignee: general → crowder
Status: NEW → ASSIGNED
Attachment #265048 - Flags: review?(igor)

Comment 2

12 years ago
I am taking few days off and will review the patch after Monday.

Updated

12 years ago
Attachment #265048 - Flags: review?(igor) → review+
(Assignee)

Comment 3

12 years ago
Created attachment 267318 [details] [diff] [review]
unbitrotted

This is just the same as before, but unbitrotted.  Worth reviewing, but don't expect a lot of differences.  I have run the test-suite both with and without this patch and no differences occur.
Attachment #265048 - Attachment is obsolete: true
Attachment #267318 - Flags: review?(igor)

Updated

12 years ago
Attachment #267318 - Flags: review?(igor) → review+
(Assignee)

Comment 4

12 years ago
jsobj.c: 3.351
(Assignee)

Updated

12 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED

Comment 5

12 years ago
/cvsroot/mozilla/js/tests/js1_5/extensions/regress-380831.js,v  <--  regress-380831.js
initial revision: 1.1
Flags: in-testsuite+

Comment 6

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