JavaScript needs whole-object watchpoints

NEW
Unassigned

Status

()

Core
JavaScript Engine
6 years ago
4 years ago

People

(Reporter: jimb, Unassigned)

Tracking

(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 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.
(Reporter)

Updated

6 years ago
Blocks: 638053

Comment 1

6 years ago
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.
(Assignee)

Updated

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].

Sebastian

[1] http://code.google.com/p/fbug/issues/detail?id=4162

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?

Sebastian
(Reporter)

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.

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