Defining a property that forces a dense array to become sparse shouldn't call a setter

RESOLVED FIXED

Status

()

defect
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: jorendorff, Assigned: jorendorff)

Tracking

Other Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment)

This shouldn't call the setter, but it does.

Array.prototype.__defineSetter__(256, function () { throw "FIT"; });
[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0]

Same goes for the first test case in Bug 509040 comment 0.
Posted patch v1Splinter Review
Sorry about that, brendan.  *This* one-liner really works, I tried it.
Assignee: general → jorendorff
Attachment #393207 - Flags: review?(brendan)
Attachment #393207 - Flags: review?(brendan) → review+
http://hg.mozilla.org/tracemonkey/rev/d95798feba04
Summary: Defining properties on sparse arrays shouldn't call setters → Defining a property that forces a dense array to become sparse shouldn't call a setter
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/d95798feba04
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.