Closed Bug 381303 Opened 18 years ago Closed 18 years ago

Incorrect object toSource when a property has both a getter and a setter

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

VERIFIED FIXED

People

(Reporter: BijuMailList, Assigned: mrbkap)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

related bug 379566 var obj = {set inn(value) {this.for = value;}, get inn() {return this.for;}}; obj.toSource(); gives ==> ({get inn () {return this['for'];}, set inn (value) {this['for'] = value;}}) on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4pre) Gecko/20070519 BonEcho/2.0.0.4pre gives ==> ({set inn (value) {this.for = value;}}) on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a5pre) Gecko/20070519 Minefield/3.0a5pre
Attached patch FixSplinter Review
The patch for bug 358594 moved the valcnt incrementing out of the if statements, which would be correct in an if/else, but this is an if/if.
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #265411 - Flags: review?(crowder)
Summary: getter/setter toSource issue → Incorrect object toSource when a property has both a getter and a setter
Comment on attachment 265411 [details] [diff] [review] Fix Ugh, woops! Thanks
Attachment #265411 - Flags: review?(crowder) → review+
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
/cvsroot/mozilla/js/tests/js1_7/extensions/regress-381303.js,v <-- regress-381303.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: