New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 673161 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 154804
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Feature



Sign in to add a comment

[FEATURE REQUEST] Implement console.breakOn

Reported by ovkadu...@gmail.com, Dec 11 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36

Steps to reproduce the problem:
It would be cool to implement breakOn (https://github.com/paulirish/break-on-access) as a part of 'console' object.
So today in order to use breakOn one should make next steps:
1. Add breakOn function to the snippets area (only once)
2. Run the snippet to make breakOn be accessible globally
3. Stop execution at the line where the object, which property we want to track, is accessible (it might be an object that is not accessible form the global scope)   
4. Go to the console and run breakOn
5. When the property is requested (get/set) the script execution will be stopped inside the getter/setter of the breakOn snippet

What is the expected behavior?
* Implement breakOn as a property of console object. It might be call like object.track() or object.breakOn(), etc.
* Having that feature implemented let omit steps 1-2
* It would be cool if instead of stopping execution on the 'debugger;' command in the snippet (as it happens now), it would stop somewhere in the real code. That is if we look at the stack trace then we will not see the snippet function at all (hide it).
* It would be really cool if in addition to what breakOn does now, it will be implemented array tracking (map/set too?).
So when there's a code like
var a = [1, 2, 3];
// console.breakOn(a, 'change');   --- draft API. It's assumed that at this point a developer goes to the console tab and run that command
a.push(10);  // should stop here
a.pop(1); // should stop here
a[2] = 5656; // should stop here

What went wrong?
FEATURE REQUEST

Did this work before? N/A 

Chrome version: 54.0.2840.98  Channel: n/a
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 23.0 r0
 

Comment 1 by ajha@chromium.org, Dec 12 2016

Labels: -Type-Bug M-57 Type-Feature
Cc: sureshkumari@chromium.org
Status: Untriaged (was: Unconfirmed)
Considering this as a feature request and making the status to Untriaged. So that the issue would get addressed.

Thank you.
Cc: kozyatinskiy@chromium.org
Labels: OS-Linux OS-Windows
Owner: l...@chromium.org
Status: Assigned (was: Untriaged)
Thanks for submitting a feature request. I've added @luoe and @kozyatinskiy who work on console and javascript debugging respectively to get their feedback.

Comment 4 by l...@chromium.org, Dec 14 2016

Mergedinto: 154804
Status: Duplicate (was: Assigned)
Thanks!  Pausing the debugger when an interesting object property changes is valuable in certain use cases.  To get the debugger to pause not on the 'debugger' keyword but 'in real code' as you said would require V8 work to accomplish.  This would enable data breakpoints, which is tracked in other issues.

In the nearer future, the breakOn code could be saved inside a DevTools Snippet and run when needed.

To follow the status on data breakpoints, please check out these issues:
 crbug.com/583565 
 crbug.com/154804 

Sign in to add a comment