Closed Bug 380831 Opened 18 years ago Closed 18 years ago

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

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Assigned: crowderbt)

Details

(Keywords: testcase)

Attachments

(1 file, 1 obsolete file)

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#}) )
Attached patch implementation v1 (obsolete) — Splinter Review
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)
I am taking few days off and will review the patch after Monday.
Attachment #265048 - Flags: review?(igor) → review+
Attached patch unbitrottedSplinter Review
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)
Attachment #267318 - Flags: review?(igor) → review+
jsobj.c: 3.351
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
/cvsroot/mozilla/js/tests/js1_5/extensions/regress-380831.js,v <-- regress-380831.js initial revision: 1.1
Flags: in-testsuite+
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.

Attachment

General

Creator:
Created:
Updated:
Size: