Web Inspector: sourceMappingURL not loaded in generated script
https://bugs.webkit.org/show_bug.cgi?id=156022
<rdar://problem/25438595>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-21
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::appendAPIBacktrace):
Synthetic CallFrames for native code will not have script identifiers.
* inspector/ScriptCallFrame.cpp:
(Inspector::ScriptCallFrame::ScriptCallFrame):
(Inspector::ScriptCallFrame::isEqual):
(Inspector::ScriptCallFrame::buildInspectorObject):
* inspector/ScriptCallFrame.h:
* inspector/protocol/Console.json:
Include the script identifier in ScriptCallFrame so we can correlate this
to the exactly script, even if there isn't a URL. The Script may have a
sourceURL, so the Web Inspector frontend may decide to show / link to it.
* inspector/ScriptCallStackFactory.cpp:
(Inspector::CreateScriptCallStackFunctor::operator()):
(Inspector::createScriptCallStackFromException):
Include SourceID when we have it.
* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator()):
* interpreter/Interpreter.h:
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::sourceID):
* interpreter/StackVisitor.h:
Access the SourceID when we have it.
Source/WebInspectorUI:
* UserInterface/Controllers/SourceMapManager.js:
(WebInspector.SourceMapManager.prototype.downloadSourceMap):
If the sourceMapURL is a dataURL at this point, we can just pass it on,
otherwise we would have returned and skipped it.
* UserInterface/Models/CallFrame.js:
(WebInspector.CallFrame.fromPayload):
Add handling for "scriptId" if it is available in the Console.CallFrame.
Don't automatically mark CallFrames that didn't have a "url" as native,
instead try to get a SourceCode.
* UserInterface/Models/Script.js:
(WebInspector.Script.prototype.get displayURL):
Used by SourceCodeLocation formatting, so behave more like Resources
when we have only have a sourceURL name. This produces output like:
"foo.js:#:#" instead of "foo.js (line #:#)"
(WebInspector.Script.prototype.get anonymous):
Easy accessor to see if this would be treated as anonymous or not.
* UserInterface/Models/SourceMap.js:
(WebInspector.SourceMap.prototype.get sourceMappingBasePathURLComponents):
Gracefully handle no path.
* UserInterface/Models/StackTrace.js:
(WebInspector.StackTrace.prototype.get firstNonNativeCallFrame):
(WebInspector.StackTrace.prototype.get firstNonNativeNonAnonymousCallFrame):
* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._appendLocationLink):
Now that "Eval Code" with a sourceURL is no longer native, we still don't
want to show it in the Web Inspector if it is anonymous. So include a stricter
version that skips native and anonymous call frames.
LayoutTests:
* inspector/console/messageAdded-from-named-evaluations-expected.txt: Added.
* inspector/console/messageAdded-from-named-evaluations.html: Added.
* inspector/debugger/js-stacktrace-expected.txt:
* inspector/model/stack-trace-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@199852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed