WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
101963
[WebInspector] Uncaught TypeError: Cannot call method 'isInlineScript' of undefined
https://bugs.webkit.org/show_bug.cgi?id=101963
Summary
[WebInspector] Uncaught TypeError: Cannot call method 'isInlineScript' of und...
johnjbarton
Reported
2012-11-12 12:09:11 PST
This is a new exception introduced within the last 7 days on WebKit master WebInspector.ResourceScriptMapping._createUISourceCode (ResourceScriptMapping.js:224) WebInspector.ResourceScriptMapping._getOrCreateTemporaryUISourceCode (ResourceScriptMapping.js:243) WebInspector.ResourceScriptMapping.rawLocationToUILocation (ResourceScriptMapping.js:61) WebInspector.Script.rawLocationToUILocation (Script.js:189) WebInspector.Script.Location.uiLocation (Script.js:238) WebInspector.LiveLocation.update (UISourceCode.js:662) WebInspector.Script.createLiveLocation (Script.js:213) WebInspector.Linkifier.linkifyRawLocation (Linkifier.js:83) WebInspector.Linkifier.linkifyLocation (Linkifier.js:69) WebInspector.ConsoleMessageImpl._linkifyLocation (ConsoleMessage.js:183) WebInspector.ConsoleMessageImpl._formatMessage (ConsoleMessage.js:133) formattedMessage (ConsoleMessage.js:174) WebInspector.ConsoleMessageImpl.toMessageElement (ConsoleMessage.js:615) WebInspector.ConsoleGroup.addMessage (ConsoleView.js:713) WebInspector.ConsoleView._appendConsoleMessage (ConsoleView.js:414) WebInspector.ConsoleView._consoleMessageAdded (ConsoleView.js:391) WebInspector.Object.dispatchEventToListeners (Object.js:101) WebInspector.ConsoleModel.addMessage (ConsoleModel.js:80) WebInspector.ConsoleDispatcher.messageAdded (ConsoleModel.js:279) InspectorBackendClass.dispatch (InspectorBackend.js:233) WebInspector.socket.onmessage (inspector.js:332) _getOrCreateTemporaryUISourceCode: function(script) { var temporaryUISourceCode = this._temporaryUISourceCodeForScriptId[script.scriptId]; if (temporaryUISourceCode) return temporaryUISourceCode; var scripts = script.isInlineScript() ? this._scriptsForSourceURL(script.sourceURL, true) : [script]; script.isInlineScript() is true, this.scripts[] has zero length temporaryUISourceCode = this._createUISourceCode(scripts); ... _createUISourceCode: function(scripts, divergedVersion) { var script = scripts[0]; var contentProvider = script.isInlineScript() ? new WebInspector.ConcatenatedScriptsContentProvider(scripts) : script; scripts has length 0, script is undefined. I am issuing reload Control + R in Chrome devtools. Seems like it could be timing sensitive, it does not happen every time.
Attachments
Add attachment
proposed patch, testcase, etc.
johnjbarton
Comment 1
2012-11-12 12:32:53 PST
Ah, maybe a change in my code rather than WebKit caused this to happen today. I changed the source I inject during reload to include { window.__qp.propertyChanges = { prop:[]}; } Note block, maybe that is causing this exception.
johnjbarton
Comment 2
2012-11-12 14:19:43 PST
<html> <head> <script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/extensions-test.js"></script> <script type="text/javascript"> window.bar = "foo = " + window.foo; function extension_testReloadInjectsCode(nextTest) { var valueWithInjectedCode; function onPageWithInjectedCodeLoaded() { webInspector.inspectedWindow.eval("window.bar", function(value) { valueWithInjectedCode = value; evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWithoutInjectedCodeLoaded); webInspector.inspectedWindow.reload(); }); } function onPageWithoutInjectedCodeLoaded() { webInspector.inspectedWindow.eval("window.bar", function(value) { output("With injected code: " + valueWithInjectedCode); output("Without injected code: " + value); nextTest(); }); } evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWithInjectedCodeLoaded); webInspector.inspectedWindow.reload({ injectedScript: "(function foo() {} window.__qp = 4;)();" }); } </script> </head> <body onload="runTest()"> <p>Layout Test for
https://bugs.webkit.org/show_bug.cgi?id=101963
</p> </body> </html>
johnjbarton
Comment 3
2012-11-12 14:21:41 PST
Looks like the syntax error in the injectedScript causes a console message that can't be linkify-ed because the script isInlineScript but does not actually exist yet.
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