JavaScript needs whole-object watchpoints




JavaScript Engine
7 years ago
9 days ago


(Reporter: jimb, Unassigned)


(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)




7 years ago
It would be neat to have watchpoints that watch all properties on a particular object, watchpoints on property additions, deletions, reconfigurations, and so on.


7 years ago
Blocks: 638053

Comment 1

7 years ago
See also Andreas Gal's comment on 
See also

The 'recursion' problem, or the extension of watchpoint to variables is critical:
   var foo ={}; ="baz";
We need to know both that was created *and* that foo was created. If the developer is concerned with 'foo' they don't want to have two different approaches if 'foo' is a property or a variable.


6 years ago
Component: JavaScript Debugging/Profiling APIs → JavaScript Engine
Product: Core → Core
As bug 637913 indicates this issue is having a high priority for Firebug. Our use case is to stop the script execution on property addition and removal[1].



Comment 3

4 years ago
I believe implementing Object.observe (bug 800355) would work here.
Depends on: 800355
So maybe this bug should be merged into bug 800355?
Or do "watchpoints" cover something additional or different?


Comment 5

4 years ago
Perhaps not additional, but different. Object.observe reports activity on some subsequent event loop tick, whereas debugger watchpoints need to trigger immediately when the modification takes place.
I'm not quite sure what you mean with "some subsequent event loop tick" but it sounds like we really need watchpoints as you describe them for our use case.

You need to log in before you can comment on or make changes to this bug.