WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
156919
Web Inspector: Debugger statement in console does not provide any call frames and debugger UI is confused
https://bugs.webkit.org/show_bug.cgi?id=156919
Summary
Web Inspector: Debugger statement in console does not provide any call frames...
Timothy Hatcher
Reported
2016-04-22 10:56:32 PDT
Steps: 1. In the console, make a method call that has an anonymous callback function with a debugger statement. Example method call below: navigator.geolocation.getCurrentPosition(function(position){ console.log(position); debugger;}, function(error){ console.log(error); debugger; }); 2. When prompted for user location access, deny permission. 3. Type `error` in the console to access the `error` argument of the callback function. Results: I expect to see the error (PositionError object) and have the ability to access its properties, but I get "ReferenceError: Can't find variable: error". The debugger is paused, but it is not paused on any specific point. I also expect to see the debugger paused on the debugger statement within the anonymous function. <
rdar://problem/25857118
>
Attachments
Patch
(10.60 KB, patch)
2016-04-22 11:13 PDT
,
Timothy Hatcher
joepeck
: review+
joepeck
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Timothy Hatcher
Comment 1
2016-04-22 11:13:39 PDT
Created
attachment 277079
[details]
Patch
Joseph Pecoraro
Comment 2
2016-04-22 11:34:27 PDT
Comment on
attachment 277079
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=277079&action=review
> Source/WebInspectorUI/ChangeLog:6 > + Web Inspector: Debugger statement in console does not provide any call frames and debugger UI is confused > + > +
https://bugs.webkit.org/show_bug.cgi?id=156919
> +
rdar://problem/25857118
Unexpected empty line (changes git log --oneline when committed).
> Source/WebInspectorUI/UserInterface/Base/Utilities.js:1260 > + if (string.includes("//# sourceURL")) > + return string;
I worry about how expensive this could get, but at the moment I don't think we ever have very large strings.
> Source/WebInspectorUI/UserInterface/Base/Utilities.js:1276 > +function isWebInspectorConsoleExpressionScript(url)
Maybe "isWebInspectorConsoleEvaluationScript". s/Expression/Evaluation/
> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:-583 > - if (isWebInspectorInternalScript(sourceURL)) > - return; > -
I think this can be left in. Now that you have separated Console Evaluations from other Internal Scripts. I don't think we want to create and keep around a WebInspector.Script for every internal script.
> Source/WebInspectorUI/UserInterface/Models/Script.js:103 > + return WebInspector.UIString("Console Expression %d").format(this._uniqueDisplayNameNumber);
Nit: I like "Console Evaluation %d" instead of "Expression". Since you can evaluate more then just a single expression in the console, its technically a whole program evaluation.
> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:211 > + var treeElement = this.contentTreeOutline.findTreeElement(representedObject);
Style: `let`
> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:466 > + return treeElement;
The other returns here should probably return `null` now.
Radar WebKit Bug Importer
Comment 3
2016-04-22 11:36:32 PDT
<
rdar://problem/25881551
>
Joseph Pecoraro
Comment 4
2016-04-22 11:50:06 PDT
Comment on
attachment 277079
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=277079&action=review
> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:551 > + if (!this._activeCallFrame) { > + this._didResumeInternal(); > + return; > + }
Maybe we should add an assert / warning for our purposes. This might catch something in the future where we expected to pause and didn't.
Joseph Pecoraro
Comment 5
2016-04-22 11:57:34 PDT
Comment on
attachment 277079
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=277079&action=review
> Source/WebInspectorUI/UserInterface/Models/Script.js:53 > static resetUniqueDisplayNameNumbers()
It doesn't look like this ever gets called the first time the inspector opens. Only after page loads. I think DebuggerManager should call this in its constructor.
Timothy Hatcher
Comment 6
2016-04-22 12:53:37 PDT
https://trac.webkit.org/r199897
Timothy Hatcher
Comment 7
2016-04-22 13:28:58 PDT
Follow up:
https://trac.webkit.org/r199899
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug