RESOLVED FIXED 139276
Web Inspector: Uncaught Exceptions when attempting to show Content Flow
https://bugs.webkit.org/show_bug.cgi?id=139276
Summary Web Inspector: Uncaught Exceptions when attempting to show Content Flow
Brian Burg
Reported 2014-12-04 16:13:10 PST
Test case: <!DOCTYPE html> <html> <body> <script> function test() { setTimeout(function() {}, 100); } eval(test.toString() + "\n//@ sourceURL= foo.js"); test(); </script> </body> </html> 1. Open the inspector 2. Resources 3. See test.html in the content view (Source Code or DOM) 4. Click "test.html" in the navigation area, and select "Extra Scripts" file:///Users/burg/repos/webkit/WebKitBuild/Release/WebInspectorUI.framework/Resources/Views/ContentView.js:130:38: CONSOLE ERROR TypeError: undefined is not a valid argument for 'instanceof' (evaluating 'representedObject instanceof WebInspector.LegacyJavaScriptProfileObject')
Attachments
[PATCH] Proposed Fix (2.14 KB, patch)
2014-12-04 17:23 PST, Joseph Pecoraro
no flags
[PATCH] Proposed Fix (3.39 KB, patch)
2014-12-04 17:37 PST, Joseph Pecoraro
no flags
[PATCH] Proposed Fix - Better ChangeLog (3.32 KB, patch)
2014-12-04 17:43 PST, Joseph Pecoraro
no flags
Radar WebKit Bug Importer
Comment 1 2014-12-04 16:13:27 PST
Joseph Pecoraro
Comment 2 2014-12-04 17:18:03 PST
That doesn't sound like an assertion, that sounds like an uncaught exception! WebInspector.LegacyJavaScriptProfileObject doesn't exist. This is blocking creating content views for anything later on (like ContentFlow). Should be easy to fix.
Joseph Pecoraro
Comment 3 2014-12-04 17:23:29 PST
Hmm, I don't know how you hit the exception with those steps to reproduce, but this patch should fix the issue.
Joseph Pecoraro
Comment 4 2014-12-04 17:23:46 PST
Created attachment 242602 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 5 2014-12-04 17:27:08 PST
* STEPS TO REPRODUCE 1. Inspect <http://umaar.github.io/css-region-demo/> 2. Select the "example-1" Content Flow in the sidebar => nothing happens, uncaught exception
Joseph Pecoraro
Comment 6 2014-12-04 17:29:08 PST
Comment on attachment 242602 [details] [PATCH] Proposed Fix Better fix coming that will actually allow us to show content flows.
Joseph Pecoraro
Comment 7 2014-12-04 17:37:07 PST
Created attachment 242603 [details] [PATCH] Proposed Fix Fixes all the uncaught exceptions. Unfortunately there are issues showing the DOM Tree of some of these Content Flows, so more bugs are in order.
Joseph Pecoraro
Comment 8 2014-12-04 17:43:28 PST
Created attachment 242604 [details] [PATCH] Proposed Fix - Better ChangeLog
Brian Burg
Comment 9 2014-12-05 10:06:18 PST
Comment on attachment 242604 [details] [PATCH] Proposed Fix - Better ChangeLog View in context: https://bugs.webkit.org/attachment.cgi?id=242604&action=review > Source/WebInspectorUI/UserInterface/Views/FolderizedTreeElement.js:240 > + parentTreeElement.insertChild(childTreeElement, insertionIndexForObjectInListSortedByFunction(childTreeElement, parentTreeElement.children, this.compareChildTreeElements.bind(this))); Is there an eslint rule that can figure out this was missing, if the callback is not defined inline? (In this case it seems like it might be harder, and certainly not possible for arbitrary property bindings. But we don't do too much in the way of dynamically binding functions to properties)
WebKit Commit Bot
Comment 10 2014-12-05 10:47:37 PST
Comment on attachment 242604 [details] [PATCH] Proposed Fix - Better ChangeLog Clearing flags on attachment: 242604 Committed r176853: <http://trac.webkit.org/changeset/176853>
WebKit Commit Bot
Comment 11 2014-12-05 10:47:41 PST
All reviewed patches have been landed. Closing bug.
Joseph Pecoraro
Comment 12 2014-12-05 10:57:38 PST
(In reply to comment #9) > Comment on attachment 242604 [details] > [PATCH] Proposed Fix - Better ChangeLog > > View in context: > https://bugs.webkit.org/attachment.cgi?id=242604&action=review > > > Source/WebInspectorUI/UserInterface/Views/FolderizedTreeElement.js:240 > > + parentTreeElement.insertChild(childTreeElement, insertionIndexForObjectInListSortedByFunction(childTreeElement, parentTreeElement.children, this.compareChildTreeElements.bind(this))); > > Is there an eslint rule that can figure out this was missing, if the > callback is not defined inline? (In this case it seems like it might be > harder, and certainly not possible for arbitrary property bindings. But we > don't do too much in the way of dynamically binding functions to properties) Hmm, I'm not sure. If ESLint can jump from the token "compareChildTreeElements" to the definition of it then yes it could. But I don't think ESLint can do that right now. The rules I see it having "no-extra-bind" work on FunctionExpressions, it doesn't check for Properties and jump to analyzing the AST where that property was assigned / declared.
Note You need to log in before you can comment on or make changes to this bug.