Bug 192174 - Web Inspector: Uncaught Exception opening Web Inspector to Debugger Tab
Summary: Web Inspector: Uncaught Exception opening Web Inspector to Debugger Tab
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-29 13:22 PST by Joseph Pecoraro
Modified: 2018-11-30 13:15 PST (History)
4 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (2.80 KB, patch)
2018-11-29 13:24 PST, Joseph Pecoraro
hi: review+
joepeck: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2018-11-29 13:22:52 PST
Uncaught Exception opening Web Inspector to Debugger Tab

Trying to load watch expressions, the panel uses InspectorBackend.runAfterPendingDispatches which tries to use WI.mainTarget.connection but the target doesn't exist it.

Lets make it do something if there is no main target.
Comment 1 Joseph Pecoraro 2018-11-29 13:24:15 PST
Created attachment 356041 [details]
[PATCH] Proposed Fix
Comment 2 Devin Rousso 2018-11-29 14:47:08 PST
Comment on attachment 356041 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=356041&action=review

r=me

> Source/WebInspectorUI/UserInterface/Protocol/Connection.js:82
> +            this._deferredScripts.push(callback);

NIT: Shouldn't this also be called `_deferredCallbacks` while you're renaming things?

> Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:178
> +            setTimeout(callback);

This won't preserve the order of execution, which I'm not sure is something we entirely care about, but is something to consider nonetheless.  Maybe add a `_deferredCallbacks` like `WI.Connection`?

Also, instead of directly checking `WI.mainTarget`, could we utilize `WI.whenTargetsAvailable` to fire all `_deferredCallbacks`?
Comment 3 Joseph Pecoraro 2018-11-30 12:43:42 PST
Comment on attachment 356041 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=356041&action=review

>> Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:178
>> +            setTimeout(callback);
> 
> This won't preserve the order of execution, which I'm not sure is something we entirely care about, but is something to consider nonetheless.  Maybe add a `_deferredCallbacks` like `WI.Connection`?
> 
> Also, instead of directly checking `WI.mainTarget`, could we utilize `WI.whenTargetsAvailable` to fire all `_deferredCallbacks`?

Hmm, I should just call it immediately. That will preserve order.
Comment 4 Joseph Pecoraro 2018-11-30 13:14:10 PST
https://trac.webkit.org/r238750
Comment 5 Radar WebKit Bug Importer 2018-11-30 13:15:37 PST
<rdar://problem/46381949>