debuggingasynchronousgoogle-chrome-devtoolswhen-js

Skip to next exception point in non-blackboxed file


I'm trying to debug some code that uses when.js. Stepping through code, at a certain point, I arrive in when.js itself, and then get buried in a long sequence of internal calls - promise fulfillments, queueing etc.

I have when.js blackboxed, but this doesn't seem to change much.

What I'd really like to do is skip forward to the next statement that is not in a blackboxed file, then immediately stop. Is there a way to achieve this?

In case there's doubt that the blackboxed script really does behave like this:

enter image description here

In my case, when.js is compiled into our app with browserify, and we have generated source maps.


Solution

  • What I'd really like to do is skip forward to the next statement that is not in a blackboxed file, then immediately stop. Is there a way to achieve this?

    That's exactly what framework blackboxing is designed for.

    I believe the problem here is that when.js is compiled into you app and the debugger fails to recognize its code as blackboxed (despite the misleading warning). Let's say all source files of your application including when.js is compiled into app.js. In that case in the inspected page there is no such thing as when.js file hence JS execution will never be paused on a function from when.js (it will always be app.js). The source maps are applied on the UI level and once you paused somewhere in app.js we can map it to the corresponding location in when.js. All of that is performed too late in the DevTools UI though. What we have to do to support this is to be able to blackbox only part of app.js corresponding to compiled source of when.js. DevTools don't support this yet. I'd appreciate if you can file a feature request on this at crbug.com/new

    Can you confirm that my understanding of the observed behavior is correct?