Closed Bug 381101 Opened 18 years ago Closed 18 years ago

Incorrect use of new setter syntax in decompilation

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Assigned: brendan)

References

Details

(Keywords: testcase)

Attachments

(2 files, 1 obsolete file)

js> (function(){ ({ x setter: function(){} + {} }) }) function () { ({set x() {} + {}}); }
I think we want this for js1.7src. Probably won't get approved for the 1.8.1 branch though. /be
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #265180 - Flags: review?(mrbkap)
Blocks: js1.7src
Summary: Incorrect use of new setter syntax → Incorrect use of new setter syntax in decompilation
This uses the wrong form (get vs getter) for lots of simple testcases. (Tested with genexp4b patch, which includes this patch.) js> (function(){ ({ x setter: function(){} }) }) function () { ({x setter: function () {}}); } js> (function(){ ({ set x(){} }) }) function () { ({x setter: function () {}}); } js> (function() { ({x getter: ({abcdefghijklmn: function(id2) { return id2; }}) }) }) function () { ({get x ijklmn:function (id2) {return id2;}}}); }
Attached patch spot-fix, v2Splinter Review
Attachment #265180 - Attachment is obsolete: true
Attachment #265184 - Flags: review?(mrbkap)
Attachment #265180 - Flags: review?(mrbkap)
OS: Mac OS X → All
Hardware: PC → All
Attachment #265184 - Flags: review?(mrbkap) → review+
Attached patch fix, v3Splinter Review
What I'm checking in. It would suffice to test for *rval == '(' to detect a generator expression (seemingly generated by a JSOP_ANONFUNOBJ op), but I stuck with the strncmp(rval, js_function_str, 8) != 0 test instead, just to avoid too much coupling to genexp decompilation. /be
Attachment #265186 - Flags: review+
Fixed on trunk: revision 3.240 date: 2007/05/18 00:48:18; author: brendan%mozilla.org; state: Exp; lines: +4 -3 Fix getter/setter decompilation to depend on generating op, not prefix string (381101, r=mrbkap). /be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Could the generator expression change ss->opcodes to avoid the string mashing sadness?
OS: All → Mac OS X
Hardware: All → PC
/cvsroot/mozilla/js/tests/js1_7/decompilation/regress-381101.js,v <-- regress-381101.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

Created:
Updated:
Size: