[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

yurys at chromium.org yurys at chromium.org
Wed Dec 22 14:37:16 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit ac86afda8c6efa0a412a395f3add74b89b8c8645
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 14 08:42:47 2010 +0000

    2010-10-08  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: [REGRESSION] Scripts panel: the bubble shows wrong values
            https://bugs.webkit.org/show_bug.cgi?id=47358
    
            Test: inspector/debugger-eval-on-call-frame.html
    
            * inspector/front-end/InjectedScript.js:
            (injectedScriptConstructor.): don't embrace expression evaluated in the local scope
            of a call frame into with(window) to avoid shadowing local variables by global ones.
    
    2010-10-08  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: [REGRESSION] Scripts panel: the bubble shows wrong values
            https://bugs.webkit.org/show_bug.cgi?id=47358
    
            * inspector/debugger-eval-on-call-frame-expected.txt: Added.
            * inspector/debugger-eval-on-call-frame.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69752 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1e700bf..0d8b69d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-08  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: [REGRESSION] Scripts panel: the bubble shows wrong values
+        https://bugs.webkit.org/show_bug.cgi?id=47358
+
+        * inspector/debugger-eval-on-call-frame-expected.txt: Added.
+        * inspector/debugger-eval-on-call-frame.html: Added.
+
 2010-10-14  Hayato Ito  <hayato at chromium.org>
 
         Unreviewed, build fix.
diff --git a/LayoutTests/inspector/debugger-eval-on-call-frame-expected.txt b/LayoutTests/inspector/debugger-eval-on-call-frame-expected.txt
new file mode 100644
index 0000000..3e1388c
--- /dev/null
+++ b/LayoutTests/inspector/debugger-eval-on-call-frame-expected.txt
@@ -0,0 +1,9 @@
+Test that evaluation in the context of top frame will see values of its local variables, even if there are global variables with same names. On success the test will print a = 2(value of the local variable a). Bug 47358.
+
+Debugger was enabled.
+Set timer for test function.
+Script execution paused.
+Evaluated in console in the top frame context: a = 2
+Script execution resumed.
+Debugger was disabled.
+
diff --git a/LayoutTests/inspector/debugger-eval-on-call-frame.html b/LayoutTests/inspector/debugger-eval-on-call-frame.html
new file mode 100644
index 0000000..f1e0e5e
--- /dev/null
+++ b/LayoutTests/inspector/debugger-eval-on-call-frame.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
+<script>
+
+var a = 1;
+function testFunction()
+{
+    var a = 2;
+    debugger;
+}
+
+var test = function()
+{
+    InspectorTest.startDebuggerTest(step1);
+
+    function step1()
+    {
+        InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
+    }
+
+    function step2()
+    {
+        InspectorTest.evaluateInConsole("a", step3);
+    }
+
+    function step3(result)
+    {
+        InspectorTest.addResult("Evaluated in console in the top frame context: a = " + result);
+        InspectorTest.completeDebuggerTest();
+    }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Test that evaluation in the context of top frame will see values
+of its local variables, even if there are global variables with
+same names. On success the test will print a = 2(value of the
+local variable a). <a href="https://bugs.webkit.org/show_bug.cgi?id=47358">Bug 47358.</a>
+</p>
+
+</body>
+</html>
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index d94637a..0429bc1 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5300,6 +5300,7 @@ inspector/debugger-step-in.html
 inspector/debugger-step-out.html
 inspector/debugger-step-over.html
 inspector/debugger-expand-scope.html
+inspector/debugger-eval-on-call-frame.html
 
 # [Qt] fast/text/bidi-explicit-embedding-past-end.html fails
 # https://bugs.webkit.org/show_bug.cgi?id=41241
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7123ee0..31ba8b6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-08  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: [REGRESSION] Scripts panel: the bubble shows wrong values
+        https://bugs.webkit.org/show_bug.cgi?id=47358
+
+        Test: inspector/debugger-eval-on-call-frame.html
+
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor.): don't embrace expression evaluated in the local scope
+        of a call frame into with(window) to avoid shadowing local variables by global ones.
+
 2010-10-13  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 5544ed5..24b270b 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -220,7 +220,7 @@ InjectedScript.prototype = {
                 if (!callFrame)
                     return props;
                 if (expression)
-                    expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression);
+                    expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression, true);
                 else {
                     // Evaluate into properties in scope of the selected call frame.
                     var scopeChain = callFrame.scopeChain;
@@ -230,7 +230,7 @@ InjectedScript.prototype = {
             } else {
                 if (!expression)
                     expression = "this";
-                expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression);
+                expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false);
             }
             if (typeof expressionResult === "object")
                 this._populatePropertyNames(expressionResult, props);
@@ -246,26 +246,29 @@ InjectedScript.prototype = {
 
     evaluate: function(expression, objectGroup)
     {
-        return this._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup);
+        return this._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup, false);
     },
 
-    _evaluateAndWrap: function(evalFunction, object, expression, objectGroup)
+    _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, isEvalOnCallFrame)
     {
         try {
-            return this._wrapObject(this._evaluateOn(evalFunction, object, expression), objectGroup);
+            return this._wrapObject(this._evaluateOn(evalFunction, object, expression, isEvalOnCallFrame), objectGroup);
         } catch (e) {
             return InjectedScript.RemoteObject.fromException(e);
         }
     },
 
-    _evaluateOn: function(evalFunction, object, expression)
+    _evaluateOn: function(evalFunction, object, expression, isEvalOnCallFrame)
     {
         // Only install command line api object for the time of evaluation.
         // Surround the expression in with statements to inject our command line API so that
         // the window object properties still take more precedent than our API functions.
         inspectedWindow.console._commandLineAPI = this._commandLineAPI;
     
-        expression = "with (window.console._commandLineAPI) { with (window) {\n" + expression + "\n} }";
+        // We don't want local variables to be shadowed by global ones when evaluating on CallFrame.
+        if (!isEvalOnCallFrame)
+            expression = "with (window) {\n" + expression + "\n} ";
+        expression = "with (window.console._commandLineAPI) {\n" + expression + "\n}";
         var value = evalFunction.call(object, expression);
     
         delete inspectedWindow.console._commandLineAPI;
@@ -303,7 +306,7 @@ InjectedScript.prototype = {
         var callFrame = this._callFrameForId(callFrameId);
         if (!callFrame)
             return false;
-        return this._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup);
+        return this._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup, true);
     },
 
     _callFrameForId: function(id)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list