[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:18:45 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 3a45175e5d9c4804aff5af1b4396c6daa2b8f478
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 2 22:53:45 2009 +0000

    2009-11-02  Patrick Mueller  <Patrick_Mueller at us.ibm.com>
    
            Reviewed by Timothy Hatcher.
    
            Each JS execution in console adds extra item into "scripts" combo
            https://bugs.webkit.org/show_bug.cgi?id=30212
    
            Added manual test
    
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
            * manual-tests/inspector/hidden-evals.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50431 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e5a6b71..4892a43 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-02  Patrick Mueller  <Patrick_Mueller at us.ibm.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Each JS execution in console adds extra item into "scripts" combo
+        https://bugs.webkit.org/show_bug.cgi?id=30212
+
+        Added manual test
+
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
+        * manual-tests/inspector/hidden-evals.html: Added.
+
 2009-11-02  Kelly Norton  <knorton at google.com>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 4aa0ab2..3c59f45 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -625,6 +625,14 @@ WebInspector.ScriptsPanel.prototype = {
         var option;
         if (scriptOrResource instanceof WebInspector.Script) {
             option = scriptOrResource.filesSelectOption;
+
+            // hasn't been added yet - happens for stepping in evals,
+            // so use the force option to force the script into the menu.
+            if (!option) {
+                this._addScriptToFilesMenu(scriptOrResource, {force: true});
+                option = scriptOrResource.filesSelectOption;
+            }
+
             console.assert(option);
         } else {
             var url = scriptOrResource.url;
@@ -637,8 +645,13 @@ WebInspector.ScriptsPanel.prototype = {
             this.filesSelectElement.selectedIndex = option.index;
     },
 
-    _addScriptToFilesMenu: function(script)
+    _addScriptToFilesMenu: function(script, options)
     {
+        var force = options && options.force;
+
+        if (!script.sourceURL && !force)
+            return;
+
         if (script.resource && this._scriptsForURLsInFilesSelect[script.sourceURL])
             return;
 
diff --git a/WebCore/manual-tests/inspector/hidden-evals.html b/WebCore/manual-tests/inspector/hidden-evals.html
new file mode 100644
index 0000000..c507bcd
--- /dev/null
+++ b/WebCore/manual-tests/inspector/hidden-evals.html
@@ -0,0 +1,118 @@
+
+<p><b>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=30212">Bug 30212</a> - Each JS execution in console adds extra item into "scripts" combo</b>
+
+<p>The following manual test creates functions via <tt>eval()</tt> and the 
+<tt>Function()</tt> constructor, some functions are named using the 
+<code>//@sourceURL=</code> directive, some aren't.  Some contain
+<tt>debugger</tt> commands, some don't.
+
+<p>The functions named <tt>f_named_X</tt> are 'named' via the 
+<code>//@sourceURL=</code> directive, the ones named <tt>f_unnamed_X</tt>
+are not.  The 'named' functions should show up in the Scripts select element used 
+to select a resource/script to view, the 'unnamed' ones should not.
+
+<ul>
+<li><p>open this page with Web Inspector
+<li><p>switch to the Scripts panel, enabling debug if required
+<li><p>the available scripts in the select element should be:
+<ul>
+<li>(program): f_named_1.eval
+<li>(program): f_named_2.eval
+<li>(program): f_named_3.eval
+<li>hidden-evals.html
+</ul>
+<li><p>click this button: <input id=button type=button value="click me">
+<li><p>debugger should stop in the <code>clickHandler</code> function
+<li><p>at this point, start stepping <b>into</b> the code
+<li><p>you should be able to step into functions <code>f_unnamed_1()</code>
+and <code>f_unnamed_2()</code>.  There are no resource/scripts in the 
+select element that contain these functions, until you actually are paused 
+in them.  At that point, entries for these functions will be in the select element,
+named: "(program)".  After pausing in both functions, there will be two "(program)"
+entries.
+<li><p>you should be able to use the next/prev buttons (to the left of the select element)
+to switch to other resources/scripts that have been opened, including the ones
+containing these functions
+<li><p>you should be able to click on the functions that exist in the 'hidden'
+resources from the Call Stack, and be shown the source; click around the
+stack trace entries to verify
+<li><p>rather than stepping into the <code>f_named_3()</code> call, press the
+resume button
+<li><p>the debugger should stop in <code>f_named_3()</code> because of the
+<code>debugger</code> command
+<li><p>rather than stepping into the <code>f_unnamed_3()</code> call, press the
+resume button
+<li><p>the debugger should stop in <code>f_unnamed_3()</code> because of the
+<code>debugger</code> command.  At this point, a third "(program)" entry for
+this function is added to the select element.
+</ul>
+
+<script>
+
+function doNothing() { /* allows multi-line functions, easier to debug */ };
+
+eval([
+    "function f_named_1() {",
+    "   doNothing();",
+    "   return 'named_1';",
+    "}",
+    "//@sourceURL=f_named_1.eval"
+].join("\n"));
+
+eval([
+    "function f_unnamed_1() {",
+    "   doNothing();",
+    "   return 'unnamed_1';",
+    "}"
+].join("\n"));
+
+f_named_2 = Function([
+    "",
+    "   doNothing();",
+    "   return 'named_2';",
+    "//@sourceURL=f_named_2.eval"
+].join("\n"));
+
+f_unnamed_2 = Function([
+    "",
+    "   doNothing();",
+    "   return 'unnamed_2';"
+].join("\n"));
+
+f_named_3 = Function([
+    "",
+    "   debugger;",
+    "   doNothing();",
+    "   return 'named_3';",
+    "//@sourceURL=f_named_3.eval"
+].join("\n"));
+
+f_unnamed_3 = Function([
+    "",
+    "   debugger;",
+    "   doNothing();",
+    "   return 'unnamed_3';"
+].join("\n"));
+
+var button = document.getElementById("button");
+
+button.addEventListener("click", clickHandler, false);
+
+function clickHandler() {
+    debugger;
+    f_named_1();
+    f_unnamed_1();
+    f_named_2();
+    f_unnamed_2();
+    
+    // press "resume" at this point
+    console.log("press resume before calling f_named_3()");
+    f_named_3();
+    
+    // press "resume" at this point
+    console.log("press resume before calling f_unnamed_3()");
+    f_unnamed_3();
+}
+
+</script>
+<!-- End -->

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list