DEFSHARP should define, not set, properties on fp->sharpArray

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: jorendorff, Assigned: jorendorff)

Tracking

Other Branch
Points:
---
Bug Flags:
wanted1.9.2 +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
Array.prototype.__defineSetter__(5000, function () { throw "FIT"; });
  var x = ({a:#5000={},b:#5000#});

This shouldn't call the setter.


Bug 479630 partly masks this bug: currently the setter isn't called if the array happens to be filled up in such a way that it remains dense. The above test works around this by starting with #5000, which makes the array sparse. But note that uneval() can create expressions that do this too:

  js> uneval(#0={a:#1=[#1#], b:#2=[#2#],c:#0#})
  #3={a:#1=[#1#], b:#2=[#2#], c:#3#}   // note sharp-ids not sequential


Here is an extra sanity test that this fix doesn't break reuse of a sharp-variable (pretty sketchy feature, if you ask me):

  assertEq(uneval(#1={a:#1#,b:#1={c:#1#}}),
           uneval(#1={a:#1#,b:#2={c:#2#}}));

We might already have a test for that.
(Assignee)

Comment 1

9 years ago
Created attachment 393193 [details] [diff] [review]
v1
Assignee: general → jorendorff
Attachment #393193 - Flags: review?(brendan)
Attachment #393193 - Flags: review?(brendan) → review+
(Assignee)

Comment 2

9 years ago
http://hg.mozilla.org/tracemonkey/rev/d2362511eaa9
Whiteboard: fixed-in-tracemonkey
(Assignee)

Comment 3

9 years ago
Sigh, this change doesn't fix the test case, thanks to bug 509047. But that will be fixed shortly, I hope...

Comment 4

9 years ago
http://hg.mozilla.org/mozilla-central/rev/d2362511eaa9
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Updated

9 years ago
Flags: wanted1.9.2+
You need to log in before you can comment on or make changes to this bug.