<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[191145] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/191145">191145</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-15 16:02:43 -0700 (Thu, 15 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/191135">r191135</a>.
https://bugs.webkit.org/show_bug.cgi?id=150197
This patch causes 50+ LayoutTest crashes related to the
inspector (Requested by ryanhaddad on #webkit).
Reverted changeset:
"Web Inspector: JavaScriptCore should parse sourceURL and
sourceMappingURL directives"
https://bugs.webkit.org/show_bug.cgi?id=150096
http://trac.webkit.org/changeset/191135</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorContentSearchUtilitiescpp">trunk/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorContentSearchUtilitiesh">trunk/Source/JavaScriptCore/inspector/ContentSearchUtilities.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptDebugServercpp">trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserLexercpp">trunk/Source/JavaScriptCore/parser/Lexer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserLexerh">trunk/Source/JavaScriptCore/parser/Lexer.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserParserh">trunk/Source/JavaScriptCore/parser/Parser.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserSourceProviderh">trunk/Source/JavaScriptCore/parser/SourceProvider.h</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTestInspectorProtocoljs">trunk/Source/WebInspectorUI/UserInterface/Test/InspectorProtocol.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordebuggersourceURLsexpectedtxt">trunk/LayoutTests/inspector/debugger/sourceURLs-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggersourceURLshtml">trunk/LayoutTests/inspector/debugger/sourceURLs.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/LayoutTests/ChangeLog        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-10-15 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r191135.
+ https://bugs.webkit.org/show_bug.cgi?id=150197
+
+ This patch causes 50+ LayoutTest crashes related to the
+ inspector (Requested by ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Web Inspector: JavaScriptCore should parse sourceURL and
+ sourceMappingURL directives"
+ https://bugs.webkit.org/show_bug.cgi?id=150096
+ http://trac.webkit.org/changeset/191135
+
</ins><span class="cx"> 2015-10-15 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: JavaScriptCore should parse sourceURL and sourceMappingURL directives
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggersourceURLsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector/debugger/sourceURLs-expected.txt (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/sourceURLs-expected.txt        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/LayoutTests/inspector/debugger/sourceURLs-expected.txt        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-Tests for the Debugger.scriptParsed sourceURL and sourceMappingURL comment directive parsing.
-
-
-== Running test suite: Debugger.scriptParsed.sourceURL-directives
--- Running test case: TestExpressionsForSourceURL
-Found Script with sourceURL 'test1.js'
-Found Script with sourceURL 'test2.js'
-Found Script with sourceURL 'test3.js'
-Found Script with sourceURL 'test4.js'
-Found Script with sourceURL 'test5.js'
-Found Script with sourceURL 'test6.js'
-Found Script with sourceURL 'test7.js'
-Found Script with sourceURL 'test8.js'
-Found Script with sourceURL 'test9.js'
-
--- Running test case: TestExpressionsForSourceMappingURL
-Found Script with sourceMappingURL 'test1.js'
-Found Script with sourceMappingURL 'test2.js'
-Found Script with sourceMappingURL 'test3.js'
-Found Script with sourceMappingURL 'test4.js'
-Found Script with sourceMappingURL 'test5.js'
-Found Script with sourceMappingURL 'test6.js'
-Found Script with sourceMappingURL 'test7.js'
-Found Script with sourceMappingURL 'test8.js'
-Found Script with sourceMappingURL 'test9.js'
-
</del></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggersourceURLshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/inspector/debugger/sourceURLs.html (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/sourceURLs.html        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/LayoutTests/inspector/debugger/sourceURLs.html        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -1,207 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../http/tests/inspector/resources/protocol-test.js"></script>
-<script>
-function test()
-{
- let suite = ProtocolTest.createAsyncSuite("Debugger.scriptParsed.sourceURL-directives");
-
- // Because InspectorTest output causes scripts to be parsed
- // we cannot check sourceURL per evaluation easily. Instead
- // just run a bunch of tests for valid and invalid directives
- // and check that the output only includes the valid results.
-
- let expressions = [];
- let sourceURLExpectations = [];
- let sourceMappingURLExpectations = [];
-
- function addInvalidTestCase(args) {
- let {expression} = args;
- expressions.push(expression);
- }
-
- function addValidTestCase(args) {
- let {expression, expected} = args;
- expressions.push(expression);
- sourceURLExpectations.push(expected);
- sourceMappingURLExpectations.push(expected);
- }
-
- suite.addTestCase({
- name: "TestExpressionsForSourceURL",
- test: (resolve, reject) => {
- for (let expression of expressions)
- ProtocolTest.evaluateInPage(expression);
-
- InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject) {
- // Ignore named inspector internal scripts.
- if (messageObject.params.url.startsWith("__WebInspector"))
- return;
-
- // Has a sourceURL, must be one of the valid ones.
- if (messageObject.params.hasSourceURL) {
- let sourceURL = messageObject.params.url;
- ProtocolTest.log(`Found Script with sourceURL '${sourceURL}'`);
- ProtocolTest.assert(sourceURLExpectations[0] === sourceURL, "Did not expect to see sourceURL: " + sourceURL);
- sourceURLExpectations.shift();
- if (!sourceURLExpectations.length)
- resolve();
- }
- }
- }
- });
-
- suite.addTestCase({
- name: "TestExpressionsForSourceMappingURL",
- test: (resolve, reject) => {
- // Rewrite the "sourceURL" to "sourceMappingURL" in the original expressions.
- for (let expression of expressions)
- ProtocolTest.evaluateInPage(expression.replace(/sourceURL/g, "sourceMappingURL"));
-
- InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject) {
- // Has a sourceMapURL, must be one of the valid ones.
- if (messageObject.params.sourceMapURL) {
- let sourceMappingURL = messageObject.params.sourceMapURL;
- ProtocolTest.log(`Found Script with sourceMappingURL '${sourceMappingURL}'`);
- ProtocolTest.assert(sourceMappingURLExpectations[0] === sourceMappingURL, "Did not expect to see sourceMappingURL: " + sourceMappingURL);
- sourceMappingURLExpectations.shift();
- if (!sourceMappingURLExpectations.length)
- resolve();
- }
- }
- }
- });
-
- // ------
-
- addInvalidTestCase({
- description: "Evaluation without a SourceURL.",
- expression: "eval('1')",
- });
-
- addInvalidTestCase({
- description: "SourceURL missing '#'.",
- expression: "eval('// sourceURL=invalid.js')",
- });
-
- addInvalidTestCase({
- description: "SourceURL missing space after '#'.",
- expression: "eval('//#sourceURL=invalid.js')",
- });
-
- addInvalidTestCase({
- description: "SourceURL with space before '#'.",
- expression: "eval('// #sourceURL=invalid.js')",
- });
-
- addInvalidTestCase({
- description: "SourceURL with multiple spaces after '#'.",
- expression: "eval('//# sourceURL=invalid.js')",
- });
-
- addInvalidTestCase({
- description: "SourceURL with space between name and '='.",
- expression: "eval('//# sourceURL =invalid.js')",
- });
-
- addInvalidTestCase({
- description: "SourceURL with quotes in value.",
- expression: "eval('//# sourceURL=\\\'invalid.js\\\'')",
- });
-
- addInvalidTestCase({
- description: "SourceURL value must be a single non-whitespace enclosed value.",
- expression: "eval('//# sourceURL=invalid.js a')",
- });
-
- addInvalidTestCase({
- description: "Unknown directive.",
- expression: "eval('//# unknown=invalid.js')",
- });
-
- addInvalidTestCase({
- description: "Missing parts.",
- expression: "eval('//#')",
- });
-
- addInvalidTestCase({
- description: "Missing parts.",
- expression: "eval('//# ')",
- });
-
- addInvalidTestCase({
- description: "Missing parts.",
- expression: "eval('//# source')",
- });
-
- addInvalidTestCase({
- description: "Missing parts.",
- expression: "eval('//# sourceURL=')",
- });
-
- // ------
-
- addValidTestCase({
- description: "SourceURL basic form.",
- expression: "eval('//# sourceURL=test1.js')",
- expected: "test1.js",
- });
-
- addValidTestCase({
- description: "SourceURL extra leading whitespace.",
- expression: "eval('//# sourceURL= test2.js')",
- expected: "test2.js",
- });
-
- addValidTestCase({
- description: "SourceURL extra trailing whitespace.",
- expression: "eval('//# sourceURL=test3.js ')",
- expected: "test3.js",
- });
-
- addValidTestCase({
- description: "SourceURL extra leading and trailing whitespace.",
- expression: "eval('//# sourceURL= test4.js ')",
- expected: "test4.js",
- });
-
- addValidTestCase({
- description: "SourceURL with tabs.",
- expression: "eval('//#\\tsourceURL=test5.js')",
- expected: "test5.js",
- });
-
- addValidTestCase({
- description: "SourceURLs not at the start of a line.",
- expression: "eval('1 //# sourceURL=test6.js')",
- expected: "test6.js",
- });
-
- addValidTestCase({
- description: "SourceURL with deprecated '@' instead of '#'.",
- expression: "eval('//@ sourceURL=test7.js ')",
- expected: "test7.js",
- });
-
- addValidTestCase({
- description: "SourceURLs not on the first line.",
- expression: "eval('\\n\\n//# sourceURL=test8.js')",
- expected: "test8.js",
- });
-
- addValidTestCase({
- description: "Multiple SourceURLs will return the first.",
- expression: "eval('//# sourceURL=test9.js\\n//# sourceURL=second.js')",
- expected: "test9.js",
- });
-
- InspectorProtocol.sendCommand("Debugger.enable", {});
- suite.runTestCasesAndFinish();
-}
-</script>
-</head>
-<body onload="runTest()">
-<p>Tests for the Debugger.scriptParsed sourceURL and sourceMappingURL comment directive parsing.</p>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-10-15 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r191135.
+ https://bugs.webkit.org/show_bug.cgi?id=150197
+
+ This patch causes 50+ LayoutTest crashes related to the
+ inspector (Requested by ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Web Inspector: JavaScriptCore should parse sourceURL and
+ sourceMappingURL directives"
+ https://bugs.webkit.org/show_bug.cgi?id=150096
+ http://trac.webkit.org/changeset/191135
+
</ins><span class="cx"> 2015-10-15 Geoffrey Garen <ggaren@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r191003.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorContentSearchUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -166,6 +166,12 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static String scriptCommentPattern(const String& name)
+{
+ // "//# <name>=<value>" and deprecated "//@"
+ return "//[#@][\040\t]" + name + "=[\040\t]*([^\\s\'\"]*)[\040\t]*$";
+}
+
</ins><span class="cx"> static String stylesheetCommentPattern(const String& name)
</span><span class="cx"> {
</span><span class="cx"> // "/*# <name>=<value> */" and deprecated "/*@"
</span><span class="lines">@@ -193,6 +199,16 @@
</span><span class="cx"> return content.substring(matches[2], matches[3] - matches[2]);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String findScriptSourceURL(const String& content)
+{
+ return findMagicComment(content, scriptCommentPattern(ASCIILiteral("sourceURL")));
+}
+
+String findScriptSourceMapURL(const String& content)
+{
+ return findMagicComment(content, scriptCommentPattern(ASCIILiteral("sourceMappingURL")));
+}
+
</ins><span class="cx"> String findStylesheetSourceMapURL(const String& content)
</span><span class="cx"> {
</span><span class="cx"> return findMagicComment(content, stylesheetCommentPattern(ASCIILiteral("sourceMappingURL")));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorContentSearchUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ContentSearchUtilities.h (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ContentSearchUtilities.h        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/JavaScriptCore/inspector/ContentSearchUtilities.h        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -48,6 +48,8 @@
</span><span class="cx"> JS_EXPORT_PRIVATE TextPosition textPositionFromOffset(size_t offset, const Vector<size_t>& lineEndings);
</span><span class="cx"> JS_EXPORT_PRIVATE std::unique_ptr<Vector<size_t>> lineEndings(const String&);
</span><span class="cx">
</span><ins>+JS_EXPORT_PRIVATE String findScriptSourceURL(const String& content);
+JS_EXPORT_PRIVATE String findScriptSourceMapURL(const String& content);
</ins><span class="cx"> JS_EXPORT_PRIVATE String findStylesheetSourceMapURL(const String& content);
</span><span class="cx">
</span><span class="cx"> } // namespace ContentSearchUtilities
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -207,8 +207,6 @@
</span><span class="cx"> script.startLine = sourceProvider->startPosition().m_line.zeroBasedInt();
</span><span class="cx"> script.startColumn = sourceProvider->startPosition().m_column.zeroBasedInt();
</span><span class="cx"> script.isContentScript = isContentScript;
</span><del>- script.sourceURL = sourceProvider->sourceURL();
- script.sourceMappingURL = sourceProvider->sourceMappingURL();
</del><span class="cx">
</span><span class="cx"> int sourceLength = script.source.length();
</span><span class="cx"> int lineCount = 1;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -604,16 +604,20 @@
</span><span class="cx">
</span><span class="cx"> String InspectorDebuggerAgent::sourceMapURLForScript(const Script& script)
</span><span class="cx"> {
</span><del>- return script.sourceMappingURL;
</del><ins>+ return ContentSearchUtilities::findScriptSourceMapURL(script.source);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorDebuggerAgent::didParseSource(JSC::SourceID sourceID, const Script& script)
</del><ins>+void InspectorDebuggerAgent::didParseSource(JSC::SourceID sourceID, const Script& inScript)
</ins><span class="cx"> {
</span><ins>+ Script script = inScript;
+ if (script.startLine <= 0 && !script.startColumn)
+ script.sourceURL = ContentSearchUtilities::findScriptSourceURL(script.source);
+ script.sourceMappingURL = sourceMapURLForScript(script);
+
</ins><span class="cx"> bool hasSourceURL = !script.sourceURL.isEmpty();
</span><span class="cx"> String scriptURL = hasSourceURL ? script.sourceURL : script.url;
</span><span class="cx"> bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr;
</span><del>- String sourceMappingURL = sourceMapURLForScript(script);
- String* sourceMapURLParam = sourceMappingURL.isNull() ? nullptr : &sourceMappingURL;
</del><ins>+ String* sourceMapURLParam = script.sourceMappingURL.isNull() ? nullptr : &script.sourceMappingURL;
</ins><span class="cx"> const bool* isContentScript = script.isContentScript ? &script.isContentScript : nullptr;
</span><span class="cx"> String scriptIDStr = String::number(sourceID);
</span><span class="cx"> m_frontendDispatcher->scriptParsed(scriptIDStr, scriptURL, script.startLine, script.startColumn, script.endLine, script.endColumn, isContentScript, sourceMapURLParam, hasSourceURLParam);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserLexercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Lexer.cpp (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Lexer.cpp        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/JavaScriptCore/parser/Lexer.cpp        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -25,21 +25,23 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "Lexer.h"
</span><span class="cx">
</span><del>-#include "BuiltinNames.h"
-#include "Identifier.h"
-#include "JSCInlines.h"
</del><span class="cx"> #include "JSFunctionInlines.h"
</span><ins>+
+#include "BuiltinNames.h"
</ins><span class="cx"> #include "JSGlobalObjectFunctions.h"
</span><del>-#include "KeywordLookup.h"
-#include "Lexer.lut.h"
</del><ins>+#include "Identifier.h"
</ins><span class="cx"> #include "Nodes.h"
</span><del>-#include "Parser.h"
</del><ins>+#include "JSCInlines.h"
+#include <wtf/dtoa.h>
</ins><span class="cx"> #include <ctype.h>
</span><span class="cx"> #include <limits.h>
</span><span class="cx"> #include <string.h>
</span><span class="cx"> #include <wtf/Assertions.h>
</span><del>-#include <wtf/dtoa.h>
</del><span class="cx">
</span><ins>+#include "KeywordLookup.h"
+#include "Lexer.lut.h"
+#include "Parser.h"
+
</ins><span class="cx"> namespace JSC {
</span><span class="cx">
</span><span class="cx"> bool isLexerKeyword(const Identifier& identifier)
</span><span class="lines">@@ -563,8 +565,6 @@
</span><span class="cx"> m_atLineStart = true;
</span><span class="cx"> m_lineStart = m_code;
</span><span class="cx"> m_lexErrorMessage = String();
</span><del>- m_sourceURL = String();
- m_sourceMappingURL = String();
</del><span class="cx">
</span><span class="cx"> m_buffer8.reserveInitialCapacity(initialReadBufferCapacity);
</span><span class="cx"> m_buffer16.reserveInitialCapacity((m_codeEnd - m_code) / 2);
</span><span class="lines">@@ -688,13 +688,6 @@
</span><span class="cx"> return m_lastToken == CONTINUE || m_lastToken == BREAK || m_lastToken == RETURN || m_lastToken == THROW;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template <typename T>
-ALWAYS_INLINE void Lexer<T>::skipWhitespace()
-{
- while (isWhiteSpace(m_current))
- shift();
-}
-
</del><span class="cx"> static NEVER_INLINE bool isNonLatin1IdentStart(UChar c)
</span><span class="cx"> {
</span><span class="cx"> return U_GET_GC_MASK(c) & U_GC_L_MASK;
</span><span class="lines">@@ -1712,58 +1705,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <typename T>
</span><del>-ALWAYS_INLINE void Lexer<T>::parseCommentDirective()
-{
- // sourceURL and sourceMappingURL directives.
- if (!consume("source"))
- return;
-
- if (consume("URL=")) {
- if (!m_sourceURL.isEmpty())
- return;
- m_sourceURL = parseCommentDirectiveValue();
- return;
- }
-
- if (consume("MappingURL=")) {
- if (!m_sourceMappingURL.isEmpty())
- return;
- m_sourceMappingURL = parseCommentDirectiveValue();
- return;
- }
-}
-
-template <typename T>
-ALWAYS_INLINE String Lexer<T>::parseCommentDirectiveValue()
-{
- skipWhitespace();
- const T* stringStart = currentSourcePtr();
- while (!isWhiteSpace(m_current) && !isLineTerminator(m_current) && m_current != '"' && m_current != '\'' && !atEnd())
- shift();
- const T* stringEnd = currentSourcePtr();
- skipWhitespace();
-
- if (!isLineTerminator(m_current) && !atEnd())
- return String();
-
- append8(stringStart, stringEnd - stringStart);
- return String(m_buffer8.data(), m_buffer8.size());
-}
-
-template <typename T>
-template <unsigned length>
-ALWAYS_INLINE bool Lexer<T>::consume(const char (&input)[length])
-{
- unsigned lengthToCheck = length - 1; // Ignore the ending NUL byte in the string literal.
-
- unsigned i = 0;
- for (; i < lengthToCheck && m_current == input[i]; i++)
- shift();
-
- return i == lengthToCheck;
-}
-
-template <typename T>
</del><span class="cx"> bool Lexer<T>::nextTokenIsColon()
</span><span class="cx"> {
</span><span class="cx"> const T* code = m_code;
</span><span class="lines">@@ -1798,7 +1739,8 @@
</span><span class="cx"> m_terminator = false;
</span><span class="cx">
</span><span class="cx"> start:
</span><del>- skipWhitespace();
</del><ins>+ while (isWhiteSpace(m_current))
+ shift();
</ins><span class="cx">
</span><span class="cx"> if (atEnd())
</span><span class="cx"> return EOFTOK;
</span><span class="lines">@@ -1956,7 +1898,7 @@
</span><span class="cx"> shift();
</span><span class="cx"> if (m_current == '/') {
</span><span class="cx"> shift();
</span><del>- goto inSingleLineCommentCheckForDirectives;
</del><ins>+ goto inSingleLineComment;
</ins><span class="cx"> }
</span><span class="cx"> if (m_current == '*') {
</span><span class="cx"> shift();
</span><span class="lines">@@ -2261,15 +2203,6 @@
</span><span class="cx"> m_atLineStart = false;
</span><span class="cx"> goto returnToken;
</span><span class="cx">
</span><del>-inSingleLineCommentCheckForDirectives:
- // Script comment directives like "//# sourceURL=test.js".
- if (UNLIKELY((m_current == '#' || m_current == '@') && isWhiteSpace(peek(1)))) {
- shift();
- shift();
- parseCommentDirective();
- }
- // Fall through to complete single line comment parsing.
-
</del><span class="cx"> inSingleLineComment:
</span><span class="cx"> while (!isLineTerminator(m_current)) {
</span><span class="cx"> if (atEnd())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserLexerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Lexer.h (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Lexer.h        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/JavaScriptCore/parser/Lexer.h        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -88,8 +88,6 @@
</span><span class="cx"> // Functions for use after parsing.
</span><span class="cx"> bool sawError() const { return m_error; }
</span><span class="cx"> String getErrorMessage() const { return m_lexErrorMessage; }
</span><del>- String sourceURL() const { return m_sourceURL; }
- String sourceMappingURL() const { return m_sourceMappingURL; }
</del><span class="cx"> void clear();
</span><span class="cx"> void setOffset(int offset, int lineStartOffset)
</span><span class="cx"> {
</span><span class="lines">@@ -116,6 +114,8 @@
</span><span class="cx"> m_terminator = terminator;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ SourceProvider* sourceProvider() const { return m_source->provider(); }
+
</ins><span class="cx"> JSTokenType lexExpectIdentifier(JSToken*, unsigned, bool strictMode);
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -152,8 +152,6 @@
</span><span class="cx"> ALWAYS_INLINE const Identifier* makeEmptyIdentifier();
</span><span class="cx">
</span><span class="cx"> ALWAYS_INLINE bool lastTokenWasRestrKeyword() const;
</span><del>-
- ALWAYS_INLINE void skipWhitespace();
</del><span class="cx">
</span><span class="cx"> template <int shiftAmount> void internalShift();
</span><span class="cx"> template <bool shouldCreateIdentifier> ALWAYS_INLINE JSTokenType parseKeyword(JSTokenData*);
</span><span class="lines">@@ -180,12 +178,6 @@
</span><span class="cx"> ALWAYS_INLINE bool parseNumberAfterExponentIndicator();
</span><span class="cx"> ALWAYS_INLINE bool parseMultilineComment();
</span><span class="cx">
</span><del>- ALWAYS_INLINE void parseCommentDirective();
- ALWAYS_INLINE String parseCommentDirectiveValue();
-
- template <unsigned length>
- ALWAYS_INLINE bool consume(const char (&input)[length]);
-
</del><span class="cx"> static const size_t initialReadBufferCapacity = 32;
</span><span class="cx">
</span><span class="cx"> int m_lineNumber;
</span><span class="lines">@@ -211,9 +203,6 @@
</span><span class="cx"> bool m_error;
</span><span class="cx"> String m_lexErrorMessage;
</span><span class="cx">
</span><del>- String m_sourceURL;
- String m_sourceMappingURL;
-
</del><span class="cx"> T m_current;
</span><span class="cx">
</span><span class="cx"> IdentifierArena* m_arena;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Parser.h (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Parser.h        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/JavaScriptCore/parser/Parser.h        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -1329,9 +1329,6 @@
</span><span class="cx"> m_numConstants);
</span><span class="cx"> result->setLoc(m_source->firstLine(), m_lexer->lineNumber(), m_lexer->currentOffset(), m_lexer->currentLineStartOffset());
</span><span class="cx"> result->setEndOffset(m_lexer->currentOffset());
</span><del>-
- m_source->provider()->setSourceURL(m_lexer->sourceURL());
- m_source->provider()->setSourceMappingURL(m_lexer->sourceMappingURL());
</del><span class="cx"> } else {
</span><span class="cx"> // We can never see a syntax error when reparsing a function, since we should have
</span><span class="cx"> // reported the error when parsing the containing program or eval code. So if we're
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserSourceProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/SourceProvider.h (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/SourceProvider.h        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/JavaScriptCore/parser/SourceProvider.h        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -49,10 +49,7 @@
</span><span class="cx"> return source().substringSharingImpl(start, end - start);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- const String& url() const { return m_url; }
- const String& sourceURL() const { return m_sourceURL; }
- const String& sourceMappingURL() const { return m_sourceMappingURL; }
-
</del><ins>+ const String& url() { return m_url; }
</ins><span class="cx"> TextPosition startPosition() const { return m_startPosition; }
</span><span class="cx"> intptr_t asID()
</span><span class="cx"> {
</span><span class="lines">@@ -65,17 +62,11 @@
</span><span class="cx"> void setValid() { m_validated = true; }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- template <typename T> friend class Parser;
</del><span class="cx">
</span><del>- void setSourceURL(const String& sourceURL) { m_sourceURL = sourceURL; }
- void setSourceMappingURL(const String& sourceMappingURL) { m_sourceMappingURL = sourceMappingURL; }
-
</del><span class="cx"> JS_EXPORT_PRIVATE void getID();
</span><span class="cx"> Vector<size_t>& lineStarts();
</span><span class="cx">
</span><span class="cx"> String m_url;
</span><del>- String m_sourceURL;
- String m_sourceMappingURL;
</del><span class="cx"> TextPosition m_startPosition;
</span><span class="cx"> bool m_validated : 1;
</span><span class="cx"> uintptr_t m_id : sizeof(uintptr_t) * 8 - 1;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-10-15 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r191135.
+ https://bugs.webkit.org/show_bug.cgi?id=150197
+
+ This patch causes 50+ LayoutTest crashes related to the
+ inspector (Requested by ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Web Inspector: JavaScriptCore should parse sourceURL and
+ sourceMappingURL directives"
+ https://bugs.webkit.org/show_bug.cgi?id=150096
+ http://trac.webkit.org/changeset/191135
+
</ins><span class="cx"> 2015-10-15 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: JavaScriptCore should parse sourceURL and sourceMappingURL directives
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTestInspectorProtocoljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test/InspectorProtocol.js (191144 => 191145)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test/InspectorProtocol.js        2015-10-15 22:51:33 UTC (rev 191144)
+++ trunk/Source/WebInspectorUI/UserInterface/Test/InspectorProtocol.js        2015-10-15 23:02:43 UTC (rev 191145)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> let messageString = typeof messageObject !== "string" ? JSON.stringify(messageObject) : messageObject;
</span><span class="cx">
</span><span class="cx"> if (ProtocolTest.dumpInspectorProtocolMessages)
</span><del>- InspectorFrontendHost.unbufferedLog(`frontend: ${messageString}`);
</del><ins>+ console.log(`frontend: ${messageString}`);
</ins><span class="cx">
</span><span class="cx"> InspectorFrontendHost.sendMessageToBackend(messageString);
</span><span class="cx"> }
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> // This matches the debug dumping in InspectorBackend, which is bypassed
</span><span class="cx"> // by InspectorProtocol. Return messages should be dumped by InspectorBackend.
</span><span class="cx"> if (ProtocolTest.dumpInspectorProtocolMessages)
</span><del>- InspectorFrontendHost.unbufferedLog("backend: " + JSON.stringify(messageObject));
</del><ins>+ console.log("backend: " + JSON.stringify(messageObject));
</ins><span class="cx">
</span><span class="cx"> // If the message has an id, then it is a reply to a command.
</span><span class="cx"> let messageId = messageObject.id;
</span></span></pre>
</div>
</div>
</body>
</html>