Closed
Bug 604781
Opened 13 years ago
Closed 12 years ago
Watchpoints set on setters do not always trigger; and, zombie setters!
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: jimb, Assigned: jorendorff)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
513 bytes,
application/javascript
|
Details | |
3.93 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
Depending on the details of how the property is defined, watchpoints on setter properties may not trigger. In particular, a watchpoint set on p.x does trigger: var p = { set x(v) { setter(v); } }; But a watchpoint set on o.x does not: var o = Object.defineProperty({}, 'x', { set:setter, enumerable:true, configurable:true }); The two should be identical, except for the specific setter function.
Reporter | ||
Updated•13 years ago
|
Summary: Watchpoints set on setters do not trigger → Watchpoints set on setters do not always trigger
Reporter | ||
Comment 1•13 years ago
|
||
Reporter | ||
Comment 2•13 years ago
|
||
<jorendorff> jimb: In the second case, the property so defined is JSPROP_READONLY [14:45] <jorendorff> jimb: which i think is nonsense, and we rightly ignore it in most places, but perhaps not in the watch_setter
Reporter | ||
Comment 3•13 years ago
|
||
Here's another lovely bit of behavior: function watcher(id,old,newval) { print("assignment watched"); return newval; } var o = { set x(v) { print("setting x"); } }; o.watch('x', watcher); Object.defineProperty(o, 'x', { value:3, writable:true, enumerable:true, configurable:true }); o.x = 3; Both the watchpoint and the setter run!
Reporter | ||
Updated•13 years ago
|
Summary: Watchpoints set on setters do not always trigger → Watchpoints set on setters do not always trigger; and, zombie setters!
Assignee | ||
Comment 4•13 years ago
|
||
This fix applies on top of bug 637985. Will request review once that one is ready.
Assignee: general → jorendorff
Assignee | ||
Updated•13 years ago
|
Attachment #527673 -
Flags: review?(jimb)
Assignee | ||
Comment 5•12 years ago
|
||
Unbitrotted. Let's get this in.
Attachment #527673 -
Attachment is obsolete: true
Attachment #595532 -
Flags: review?(jimb)
Attachment #527673 -
Flags: review?(jimb)
Assignee | ||
Comment 6•12 years ago
|
||
Incidentally the tests pass even without the change to obj_watch, I think because that property is not JSPROP_READONLY anymore; but there is no point having a line of code in obj_watch that doesn't do anything.
Reporter | ||
Updated•12 years ago
|
Attachment #595532 -
Flags: review?(jimb) → review+
Assignee | ||
Comment 7•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/502b21011c3e
Comment 8•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/502b21011c3e
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in
before you can comment on or make changes to this bug.
Description
•