Open vsmenon opened 8 years ago
by "trap" do you mean "debugger;" statement? http://www.ecma-international.org/ecma-262/6.0/#sec-debugger-statement
When https://bugs.chromium.org/p/chromium/issues/detail?id=589980&q=component%3APlatform%3EDevTools%20pause&sort=-stars&colspec=ID%20Owner%20Summary%20Modified%20Stars is fixed, chrome devtools will support this case via blackboxing and pause on all exceptions.
A right click to blackbox each script when you see it throw an error is all that is required.
Longer term there are two other options:
The debugging experience, especially for large apps, is much better if we automatically trap on certain errors.
Catch on all exceptions doesn't seem to work well with Angular2 - they explicitly throw to record stack traces. One alternative is to make that work.
Another is to trap on explicit Dart errors (NullValue, NSM, Cast) - but this misses cases where we rely on the JS implementation to throw TypeErrors (null method or field).