<!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:

&quot;Web Inspector: JavaScriptCore should parse sourceURL and
sourceMappingURL directives&quot;
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  &lt;commit-queue@webkit.org&gt;
+
+        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:
+
+        &quot;Web Inspector: JavaScriptCore should parse sourceURL and
+        sourceMappingURL directives&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=150096
+        http://trac.webkit.org/changeset/191135
+
</ins><span class="cx"> 2015-10-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</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>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script src=&quot;../../http/tests/inspector/resources/protocol-test.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;
-function test()
-{
-    let suite = ProtocolTest.createAsyncSuite(&quot;Debugger.scriptParsed.sourceURL-directives&quot;);
-
-    // 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: &quot;TestExpressionsForSourceURL&quot;,
-        test: (resolve, reject) =&gt; {
-            for (let expression of expressions)
-                ProtocolTest.evaluateInPage(expression);
-
-            InspectorProtocol.eventHandler[&quot;Debugger.scriptParsed&quot;] = function(messageObject) {
-                // Ignore named inspector internal scripts.
-                if (messageObject.params.url.startsWith(&quot;__WebInspector&quot;))
-                    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, &quot;Did not expect to see sourceURL: &quot; + sourceURL);
-                    sourceURLExpectations.shift();
-                    if (!sourceURLExpectations.length)
-                        resolve();
-                }
-            }
-        }
-    });
-
-    suite.addTestCase({
-        name: &quot;TestExpressionsForSourceMappingURL&quot;,
-        test: (resolve, reject) =&gt; {
-            // Rewrite the &quot;sourceURL&quot; to &quot;sourceMappingURL&quot; in the original expressions.
-            for (let expression of expressions)
-                ProtocolTest.evaluateInPage(expression.replace(/sourceURL/g, &quot;sourceMappingURL&quot;));
-
-            InspectorProtocol.eventHandler[&quot;Debugger.scriptParsed&quot;] = 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, &quot;Did not expect to see sourceMappingURL: &quot; + sourceMappingURL);
-                    sourceMappingURLExpectations.shift();
-                    if (!sourceMappingURLExpectations.length)
-                        resolve();
-                }
-            }
-        }
-    });
-
-    // ------
-
-    addInvalidTestCase({
-        description: &quot;Evaluation without a SourceURL.&quot;,
-        expression: &quot;eval('1')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;SourceURL missing '#'.&quot;,
-        expression: &quot;eval('// sourceURL=invalid.js')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;SourceURL missing space after '#'.&quot;,
-        expression: &quot;eval('//#sourceURL=invalid.js')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;SourceURL with space before '#'.&quot;,
-        expression: &quot;eval('// #sourceURL=invalid.js')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;SourceURL with multiple spaces after '#'.&quot;,
-        expression: &quot;eval('//#  sourceURL=invalid.js')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;SourceURL with space between name and '='.&quot;,
-        expression: &quot;eval('//# sourceURL =invalid.js')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;SourceURL with quotes in value.&quot;,
-        expression: &quot;eval('//# sourceURL=\\\'invalid.js\\\'')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;SourceURL value must be a single non-whitespace enclosed value.&quot;,
-        expression: &quot;eval('//# sourceURL=invalid.js a')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;Unknown directive.&quot;,
-        expression: &quot;eval('//# unknown=invalid.js')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;Missing parts.&quot;,
-        expression: &quot;eval('//#')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;Missing parts.&quot;,
-        expression: &quot;eval('//# ')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;Missing parts.&quot;,
-        expression: &quot;eval('//# source')&quot;,
-    });
-
-    addInvalidTestCase({
-        description: &quot;Missing parts.&quot;,
-        expression: &quot;eval('//# sourceURL=')&quot;,
-    });
-
-    // ------
-
-    addValidTestCase({
-        description: &quot;SourceURL basic form.&quot;,
-        expression: &quot;eval('//# sourceURL=test1.js')&quot;,
-        expected: &quot;test1.js&quot;,
-    });
-
-    addValidTestCase({
-        description: &quot;SourceURL extra leading whitespace.&quot;,
-        expression: &quot;eval('//# sourceURL=   test2.js')&quot;,
-        expected: &quot;test2.js&quot;,
-    });
-
-    addValidTestCase({
-        description: &quot;SourceURL extra trailing whitespace.&quot;,
-        expression: &quot;eval('//# sourceURL=test3.js    ')&quot;,
-        expected: &quot;test3.js&quot;,
-    });
-
-    addValidTestCase({
-        description: &quot;SourceURL extra leading and trailing whitespace.&quot;,
-        expression: &quot;eval('//# sourceURL=   test4.js   ')&quot;,
-        expected: &quot;test4.js&quot;,
-    });
-
-    addValidTestCase({
-        description: &quot;SourceURL with tabs.&quot;,
-        expression: &quot;eval('//#\\tsourceURL=test5.js')&quot;,
-        expected: &quot;test5.js&quot;,
-    });
-
-    addValidTestCase({
-        description: &quot;SourceURLs not at the start of a line.&quot;,
-        expression: &quot;eval('1 //# sourceURL=test6.js')&quot;,
-        expected: &quot;test6.js&quot;,
-    });
-
-    addValidTestCase({
-        description: &quot;SourceURL with deprecated '@' instead of '#'.&quot;,
-        expression: &quot;eval('//@ sourceURL=test7.js   ')&quot;,
-        expected: &quot;test7.js&quot;,
-    });
-
-    addValidTestCase({
-        description: &quot;SourceURLs not on the first line.&quot;,
-        expression: &quot;eval('\\n\\n//# sourceURL=test8.js')&quot;,
-        expected: &quot;test8.js&quot;,
-    });
-
-    addValidTestCase({
-        description: &quot;Multiple SourceURLs will return the first.&quot;,
-        expression: &quot;eval('//# sourceURL=test9.js\\n//# sourceURL=second.js')&quot;,
-        expected: &quot;test9.js&quot;,
-    });
-
-    InspectorProtocol.sendCommand(&quot;Debugger.enable&quot;, {});
-    suite.runTestCasesAndFinish();
-}
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload=&quot;runTest()&quot;&gt;
-&lt;p&gt;Tests for the Debugger.scriptParsed sourceURL and sourceMappingURL comment directive parsing.&lt;/p&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</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  &lt;commit-queue@webkit.org&gt;
+
+        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:
+
+        &quot;Web Inspector: JavaScriptCore should parse sourceURL and
+        sourceMappingURL directives&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=150096
+        http://trac.webkit.org/changeset/191135
+
</ins><span class="cx"> 2015-10-15  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</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&amp; name)
+{
+    // &quot;//# &lt;name&gt;=&lt;value&gt;&quot; and deprecated &quot;//@&quot;
+    return &quot;//[#@][\040\t]&quot; + name + &quot;=[\040\t]*([^\\s\'\&quot;]*)[\040\t]*$&quot;;
+}
+
</ins><span class="cx"> static String stylesheetCommentPattern(const String&amp; name)
</span><span class="cx"> {
</span><span class="cx">     // &quot;/*# &lt;name&gt;=&lt;value&gt; */&quot; and deprecated &quot;/*@&quot;
</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&amp; content)
+{
+    return findMagicComment(content, scriptCommentPattern(ASCIILiteral(&quot;sourceURL&quot;)));
+}
+
+String findScriptSourceMapURL(const String&amp; content)
+{
+    return findMagicComment(content, scriptCommentPattern(ASCIILiteral(&quot;sourceMappingURL&quot;)));
+}
+
</ins><span class="cx"> String findStylesheetSourceMapURL(const String&amp; content)
</span><span class="cx"> {
</span><span class="cx">     return findMagicComment(content, stylesheetCommentPattern(ASCIILiteral(&quot;sourceMappingURL&quot;)));
</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&lt;size_t&gt;&amp; lineEndings);
</span><span class="cx"> JS_EXPORT_PRIVATE std::unique_ptr&lt;Vector&lt;size_t&gt;&gt; lineEndings(const String&amp;);
</span><span class="cx"> 
</span><ins>+JS_EXPORT_PRIVATE String findScriptSourceURL(const String&amp; content);
+JS_EXPORT_PRIVATE String findScriptSourceMapURL(const String&amp; content);
</ins><span class="cx"> JS_EXPORT_PRIVATE String findStylesheetSourceMapURL(const String&amp; 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-&gt;startPosition().m_line.zeroBasedInt();
</span><span class="cx">     script.startColumn = sourceProvider-&gt;startPosition().m_column.zeroBasedInt();
</span><span class="cx">     script.isContentScript = isContentScript;
</span><del>-    script.sourceURL = sourceProvider-&gt;sourceURL();
-    script.sourceMappingURL = sourceProvider-&gt;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&amp; 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&amp; script)
</del><ins>+void InspectorDebuggerAgent::didParseSource(JSC::SourceID sourceID, const Script&amp; inScript)
</ins><span class="cx"> {
</span><ins>+    Script script = inScript;
+    if (script.startLine &lt;= 0 &amp;&amp; !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 ? &amp;hasSourceURL : nullptr;
</span><del>-    String sourceMappingURL = sourceMapURLForScript(script);
-    String* sourceMapURLParam = sourceMappingURL.isNull() ? nullptr : &amp;sourceMappingURL;
</del><ins>+    String* sourceMapURLParam = script.sourceMappingURL.isNull() ? nullptr : &amp;script.sourceMappingURL;
</ins><span class="cx">     const bool* isContentScript = script.isContentScript ? &amp;script.isContentScript : nullptr;
</span><span class="cx">     String scriptIDStr = String::number(sourceID);
</span><span class="cx">     m_frontendDispatcher-&gt;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 &quot;config.h&quot;
</span><span class="cx"> #include &quot;Lexer.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;BuiltinNames.h&quot;
-#include &quot;Identifier.h&quot;
-#include &quot;JSCInlines.h&quot;
</del><span class="cx"> #include &quot;JSFunctionInlines.h&quot;
</span><ins>+
+#include &quot;BuiltinNames.h&quot;
</ins><span class="cx"> #include &quot;JSGlobalObjectFunctions.h&quot;
</span><del>-#include &quot;KeywordLookup.h&quot;
-#include &quot;Lexer.lut.h&quot;
</del><ins>+#include &quot;Identifier.h&quot;
</ins><span class="cx"> #include &quot;Nodes.h&quot;
</span><del>-#include &quot;Parser.h&quot;
</del><ins>+#include &quot;JSCInlines.h&quot;
+#include &lt;wtf/dtoa.h&gt;
</ins><span class="cx"> #include &lt;ctype.h&gt;
</span><span class="cx"> #include &lt;limits.h&gt;
</span><span class="cx"> #include &lt;string.h&gt;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><del>-#include &lt;wtf/dtoa.h&gt;
</del><span class="cx"> 
</span><ins>+#include &quot;KeywordLookup.h&quot;
+#include &quot;Lexer.lut.h&quot;
+#include &quot;Parser.h&quot;
+
</ins><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> bool isLexerKeyword(const Identifier&amp; 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 &lt;typename T&gt;
-ALWAYS_INLINE void Lexer&lt;T&gt;::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) &amp; 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 &lt;typename T&gt;
</span><del>-ALWAYS_INLINE void Lexer&lt;T&gt;::parseCommentDirective()
-{
-    // sourceURL and sourceMappingURL directives.
-    if (!consume(&quot;source&quot;))
-        return;
-
-    if (consume(&quot;URL=&quot;)) {
-        if (!m_sourceURL.isEmpty())
-            return;
-        m_sourceURL = parseCommentDirectiveValue();
-        return;
-    }
-
-    if (consume(&quot;MappingURL=&quot;)) {
-        if (!m_sourceMappingURL.isEmpty())
-            return;
-        m_sourceMappingURL = parseCommentDirectiveValue();
-        return;
-    }
-}
-
-template &lt;typename T&gt;
-ALWAYS_INLINE String Lexer&lt;T&gt;::parseCommentDirectiveValue()
-{
-    skipWhitespace();
-    const T* stringStart = currentSourcePtr();
-    while (!isWhiteSpace(m_current) &amp;&amp; !isLineTerminator(m_current) &amp;&amp; m_current != '&quot;' &amp;&amp; m_current != '\'' &amp;&amp; !atEnd())
-        shift();
-    const T* stringEnd = currentSourcePtr();
-    skipWhitespace();
-
-    if (!isLineTerminator(m_current) &amp;&amp; !atEnd())
-        return String();
-
-    append8(stringStart, stringEnd - stringStart);
-    return String(m_buffer8.data(), m_buffer8.size());
-}
-
-template &lt;typename T&gt;
-template &lt;unsigned length&gt;
-ALWAYS_INLINE bool Lexer&lt;T&gt;::consume(const char (&amp;input)[length])
-{
-    unsigned lengthToCheck = length - 1; // Ignore the ending NUL byte in the string literal.
-
-    unsigned i = 0;
-    for (; i &lt; lengthToCheck &amp;&amp; m_current == input[i]; i++)
-        shift();
-
-    return i == lengthToCheck;
-}
-
-template &lt;typename T&gt;
</del><span class="cx"> bool Lexer&lt;T&gt;::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 &quot;//# sourceURL=test.js&quot;.
-    if (UNLIKELY((m_current == '#' || m_current == '@') &amp;&amp; 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-&gt;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 &lt;int shiftAmount&gt; void internalShift();
</span><span class="cx">     template &lt;bool shouldCreateIdentifier&gt; 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 &lt;unsigned length&gt;
-    ALWAYS_INLINE bool consume(const char (&amp;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-&gt;setLoc(m_source-&gt;firstLine(), m_lexer-&gt;lineNumber(), m_lexer-&gt;currentOffset(), m_lexer-&gt;currentLineStartOffset());
</span><span class="cx">         result-&gt;setEndOffset(m_lexer-&gt;currentOffset());
</span><del>-
-        m_source-&gt;provider()-&gt;setSourceURL(m_lexer-&gt;sourceURL());
-        m_source-&gt;provider()-&gt;setSourceMappingURL(m_lexer-&gt;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&amp; url() const { return m_url; }
-        const String&amp; sourceURL() const { return m_sourceURL; }
-        const String&amp; sourceMappingURL() const { return m_sourceMappingURL; }
-
</del><ins>+        const String&amp; 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 &lt;typename T&gt; friend class Parser;
</del><span class="cx"> 
</span><del>-        void setSourceURL(const String&amp; sourceURL) { m_sourceURL = sourceURL; }
-        void setSourceMappingURL(const String&amp; sourceMappingURL) { m_sourceMappingURL = sourceMappingURL; }
-
</del><span class="cx">         JS_EXPORT_PRIVATE void getID();
</span><span class="cx">         Vector&lt;size_t&gt;&amp; 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  &lt;commit-queue@webkit.org&gt;
+
+        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:
+
+        &quot;Web Inspector: JavaScriptCore should parse sourceURL and
+        sourceMappingURL directives&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=150096
+        http://trac.webkit.org/changeset/191135
+
</ins><span class="cx"> 2015-10-15  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</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 !== &quot;string&quot; ? 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(&quot;backend: &quot; + JSON.stringify(messageObject));
</del><ins>+        console.log(&quot;backend: &quot; + 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>