Closed Bug 509047 Opened 11 years ago Closed 11 years ago

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

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Assigned: jorendorff)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

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.
Attached 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: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.