Last Comment Bug 638044 - JavaScript needs whole-object watchpoints
: JavaScript needs whole-object watchpoints
Status: NEW
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal with 3 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: jsd
: Jason Orendorff [:jorendorff]
Depends on: 800355
Blocks: 609924 638053
  Show dependency treegraph
Reported: 2011-03-02 01:56 PST by Jim Blandy :jimb
Modified: 2013-07-09 14:01 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Jim Blandy :jimb 2011-03-02 01:56:51 PST
It would be neat to have watchpoints that watch all properties on a particular object, watchpoints on property additions, deletions, reconfigurations, and so on.
Comment 1 User image John J. Barton 2011-03-02 07:36:32 PST
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.
Comment 2 User image Sebastian Zartner [:sebo] 2013-04-09 13:26:57 PDT
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 User image David Bruant 2013-04-09 13:37:54 PDT
I believe implementing Object.observe (bug 800355) would work here.
Comment 4 User image Sebastian Zartner [:sebo] 2013-07-05 16:18:35 PDT
So maybe this bug should be merged into bug 800355?
Or do "watchpoints" cover something additional or different?

Comment 5 User image Jim Blandy :jimb 2013-07-05 23:49:35 PDT
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.
Comment 6 User image Sebastian Zartner [:sebo] 2013-07-09 14:01:05 PDT
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.


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