Bug 101963
| Summary: | [WebInspector] Uncaught TypeError: Cannot call method 'isInlineScript' of undefined | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | johnjbarton <johnjbarton> |
| Component: | Web Inspector (Deprecated) | Assignee: | Vsevolod Vlasov <vsevik> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | apavlov, burg, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, yurys |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | Linux | ||
johnjbarton
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
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
<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
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.