Title: [143240] trunk
Revision
143240
Author
commit-qu...@webkit.org
Date
2013-02-18 10:33:04 -0800 (Mon, 18 Feb 2013)

Log Message

[JSC]: ASSERT in KURL(ParsedURLStringTag) under sourceMapURLForScript
https://bugs.webkit.org/show_bug.cgi?id=109987

Patch by Joseph Pecoraro <pecor...@apple.com> on 2013-02-18
Reviewed by Pavel Feldman.

Source/WebCore:

Improved an existing test to cover this.

* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::dispatchDidParseSource):
Remove the sourceURL parsing and script.url replacement from the JSC
implementation of ScriptDebugServer. The WebCore inspector code that
this was added for already does this, at a more appropriate time.

LayoutTests:

* inspector/debugger/source-url-comment-expected.txt:
* inspector/debugger/source-url-comment.html:
Add a test for a sourceURL with a non-relative path. This was causing
an ASSERT, rightfully so, in JSC builds.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (143239 => 143240)


--- trunk/LayoutTests/ChangeLog	2013-02-18 18:21:59 UTC (rev 143239)
+++ trunk/LayoutTests/ChangeLog	2013-02-18 18:33:04 UTC (rev 143240)
@@ -1,3 +1,15 @@
+2013-02-18  Joseph Pecoraro  <pecor...@apple.com>
+
+        [JSC]: ASSERT in KURL(ParsedURLStringTag) under sourceMapURLForScript
+        https://bugs.webkit.org/show_bug.cgi?id=109987
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/debugger/source-url-comment-expected.txt:
+        * inspector/debugger/source-url-comment.html:
+        Add a test for a sourceURL with a non-relative path. This was causing
+        an ASSERT, rightfully so, in JSC builds.
+
 2013-02-18  Mike West  <mk...@chromium.org>
 
         compareDocumentPosition reports disconnected nodes as following each other

Modified: trunk/LayoutTests/inspector/debugger/source-url-comment-expected.txt (143239 => 143240)


--- trunk/LayoutTests/inspector/debugger/source-url-comment-expected.txt	2013-02-18 18:21:59 UTC (rev 143239)
+++ trunk/LayoutTests/inspector/debugger/source-url-comment-expected.txt	2013-02-18 18:33:04 UTC (rev 143240)
@@ -11,5 +11,9 @@
 Running: testSourceURLCommentInDynamicScript
 function keepAliveInDynamicScript() {}
 //@ sourceURL=dynamicScriptURL.js
+
+Running: testNonRelativeURL
+function relativeURLScript() {}
+//@ sourceURL=/js/nonRelativeURL.js
 Debugger was disabled.
 

Modified: trunk/LayoutTests/inspector/debugger/source-url-comment.html (143239 => 143240)


--- trunk/LayoutTests/inspector/debugger/source-url-comment.html	2013-02-18 18:21:59 UTC (rev 143239)
+++ trunk/LayoutTests/inspector/debugger/source-url-comment.html	2013-02-18 18:33:04 UTC (rev 143240)
@@ -13,6 +13,11 @@
     eval("function keepAlive() {}\n//@ sourceURL=evalURL.js");
 }
 
+function doEvalWithNonRelativeURL()
+{
+    eval("function relativeURLScript() {}\n//@ sourceURL=/js/nonRelativeURL.js");
+}
+
 function doDynamicScript()
 {
     var scriptElement = document.createElement("script");
@@ -87,6 +92,24 @@
                 forEachScriptMatchingURL("dynamicScriptURL.js", checkScriptHasSourceURL);
                 next();
             }
+        },
+
+        function testNonRelativeURL(next)
+        {
+            InspectorTest.showScriptSource("nonRelativeURL.js", didShowScriptSource);
+            InspectorTest.evaluateInPage("setTimeout(doEvalWithNonRelativeURL, 0)");
+
+            function didShowScriptSource(sourceFrame)
+            {
+                function checkScriptHasSourceURL(script)
+                {
+                    InspectorTest.assertTrue(script.hasSourceURL, "hasSourceURL flag is not set for eval with a non-relative URL in a sourceURL comment");
+                }
+
+                InspectorTest.addResult(sourceFrame.textEditor.text());
+                forEachScriptMatchingURL("nonRelativeURL.js", checkScriptHasSourceURL);
+                next();
+            }
         }
     ]);
 };

Modified: trunk/Source/WebCore/ChangeLog (143239 => 143240)


--- trunk/Source/WebCore/ChangeLog	2013-02-18 18:21:59 UTC (rev 143239)
+++ trunk/Source/WebCore/ChangeLog	2013-02-18 18:33:04 UTC (rev 143240)
@@ -1,3 +1,18 @@
+2013-02-18  Joseph Pecoraro  <pecor...@apple.com>
+
+        [JSC]: ASSERT in KURL(ParsedURLStringTag) under sourceMapURLForScript
+        https://bugs.webkit.org/show_bug.cgi?id=109987
+
+        Reviewed by Pavel Feldman.
+
+        Improved an existing test to cover this.
+
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::dispatchDidParseSource):
+        Remove the sourceURL parsing and script.url replacement from the JSC
+        implementation of ScriptDebugServer. The WebCore inspector code that
+        this was added for already does this, at a more appropriate time.
+
 2013-02-18  Mike West  <mk...@chromium.org>
 
         compareDocumentPosition reports disconnected nodes as following each other

Modified: trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp (143239 => 143240)


--- trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp	2013-02-18 18:21:59 UTC (rev 143239)
+++ trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp	2013-02-18 18:33:04 UTC (rev 143240)
@@ -292,14 +292,6 @@
     script.startColumn = sourceProvider->startPosition().m_column.zeroBasedInt();
     script.isContentScript = isContentScript;
 
-#if ENABLE(INSPECTOR)
-    if (!script.startLine && !script.startColumn) {
-        String sourceURL = ContentSearchUtils::findSourceURL(script.source);
-        if (!sourceURL.isEmpty())
-            script.url = ""
-    }
-#endif
-
     int sourceLength = script.source.length();
     int lineCount = 1;
     int lastLineStart = 0;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to