Summary: | Web Inspector: Provide $exception in the console for the thrown exception value | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||||
Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | burg, graouts, joepeck, mark.lam, timothy, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Joseph Pecoraro
2014-11-13 20:16:32 PST
Created attachment 241541 [details]
[PATCH] WIP - Needs Tests
I only expose "$e" in console autocompletion when we are paused because of an exception. I still think "$exception" might be clearer.
Comment on attachment 241541 [details] [PATCH] WIP - Needs Tests View in context: https://bugs.webkit.org/attachment.cgi?id=241541&action=review > Source/JavaScriptCore/inspector/InjectedScriptSource.js:1054 > + this.$e = injectedScript._exceptionValue; I am fine with $e or $exception. Autocomplete will kick in. Created attachment 241758 [details]
[PATCH] Proposed Fix
Now with tests and proper handling of $exception inside catch blocks.
Comment on attachment 241758 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=241758&action=review > LayoutTests/inspector/debugger/command-line-api-exception.html:60 > + WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) { Note that these tests use Event.CallFramesDidChange and not Event.Paused because DebuggerManager's Event.Paused/Event.Resumed do not get called if we immediately pause after stepping (50ms). This event will get called on every pause. Comment on attachment 241758 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=241758&action=review > LayoutTests/inspector/debugger/command-line-api-exception-nested-catch-expected.txt:12 > +CONSOLE MESSAGE: line 67: inner exception > +CONSOLE MESSAGE: line 69: outer exception > +Checks that $exception is the value of the current exception, even in nested catch blocks. > + > +BEFORE : $exception => undefined > +OUTER 1: $exception => outer exception > +INNER 1: $exception => inner exception > +INNER 2: $exception => inner exception > + CATCH: $exception === e2 ? true > +OUTER 2: $exception => outer exception > + CATCH: $exception === e1 ? true > +AFTER : $exception => undefined Nice test. > Source/JavaScriptCore/inspector/InjectedScriptManager.cpp:128 > + for (auto it = m_idToInjectedScript.begin(); it != m_idToInjectedScript.end(); ++it) > + it->value.clearExceptionValue(); for (auto injectedScript : m_idToInjectedScript.values()) ? |