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
Mentors:
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:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description 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 John J. Barton 2011-03-02 07:36:32 PST
See also Andreas Gal's comment on 
See also https://bugzilla.mozilla.org/show_bug.cgi?id=579342

The 'recursion' problem, or the extension of watchpoint to variables is critical:
   var foo ={};
   foo.bar ="baz";
We need to know both that foo.bar 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 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].

Sebastian

[1] http://code.google.com/p/fbug/issues/detail?id=4162
Comment 3 David Bruant 2013-04-09 13:37:54 PDT
I believe implementing Object.observe (bug 800355) would work here.
Comment 4 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?

Sebastian
Comment 5 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 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.

Sebastian

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