2011-01-26 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jan 2011 10:19:04 +0000 (10:19 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jan 2011 10:19:04 +0000 (10:19 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: Incorrect on-hover evaluation of a variable named 'profile'.
        https://bugs.webkit.org/show_bug.cgi?id=53018

        * inspector/InjectedScript.cpp:
        (WebCore::InjectedScript::evaluate):
        (WebCore::InjectedScript::evaluateOnCallFrame):
        (WebCore::InjectedScript::getCompletions):
        (WebCore::InjectedScript::getCompletionsOnCallFrame):
        * inspector/InjectedScript.h:
        * inspector/InjectedScriptSource.js:
        (.):
        * inspector/Inspector.idl:
        * inspector/InspectorDebuggerAgent.cpp:
        (WebCore::InspectorDebuggerAgent::evaluateOnCallFrame):
        (WebCore::InspectorDebuggerAgent::getCompletionsOnCallFrame):
        * inspector/InspectorDebuggerAgent.h:
        * inspector/InspectorRuntimeAgent.cpp:
        (WebCore::InspectorRuntimeAgent::evaluate):
        (WebCore::InspectorRuntimeAgent::getCompletions):
        * inspector/InspectorRuntimeAgent.h:
        * inspector/front-end/ConsoleView.js:
        (WebInspector.ConsoleView.prototype.completions):
        (WebInspector.ConsoleView.prototype.evalInInspectedWindow):
        (WebInspector.ConsoleView.prototype._enterKeyPressed):
        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame.updatingCallbackWrapper):
        (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame):
        * inspector/front-end/SourceFrame.js:
        (WebInspector.SourceFrame.prototype._showPopup):
        * inspector/front-end/WatchExpressionsSidebarPane.js:
        (WebInspector.WatchExpressionsSection.prototype.update):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76680 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/inspector/InjectedScript.cpp
Source/WebCore/inspector/InjectedScript.h
Source/WebCore/inspector/InjectedScriptSource.js
Source/WebCore/inspector/Inspector.idl
Source/WebCore/inspector/InspectorDebuggerAgent.cpp
Source/WebCore/inspector/InspectorDebuggerAgent.h
Source/WebCore/inspector/InspectorRuntimeAgent.cpp
Source/WebCore/inspector/InspectorRuntimeAgent.h
Source/WebCore/inspector/front-end/ConsoleView.js
Source/WebCore/inspector/front-end/ScriptsPanel.js
Source/WebCore/inspector/front-end/SourceFrame.js
Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js

index ca9dfdd59541df448c3da53dc5ea9e032a3d52c0..f7464b847cb68c049ef046884a2b20eb756a0f5f 100644 (file)
@@ -1,3 +1,39 @@
+2011-01-26  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: Incorrect on-hover evaluation of a variable named 'profile'.
+        https://bugs.webkit.org/show_bug.cgi?id=53018
+
+        * inspector/InjectedScript.cpp:
+        (WebCore::InjectedScript::evaluate):
+        (WebCore::InjectedScript::evaluateOnCallFrame):
+        (WebCore::InjectedScript::getCompletions):
+        (WebCore::InjectedScript::getCompletionsOnCallFrame):
+        * inspector/InjectedScript.h:
+        * inspector/InjectedScriptSource.js:
+        (.):
+        * inspector/Inspector.idl:
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::evaluateOnCallFrame):
+        (WebCore::InspectorDebuggerAgent::getCompletionsOnCallFrame):
+        * inspector/InspectorDebuggerAgent.h:
+        * inspector/InspectorRuntimeAgent.cpp:
+        (WebCore::InspectorRuntimeAgent::evaluate):
+        (WebCore::InspectorRuntimeAgent::getCompletions):
+        * inspector/InspectorRuntimeAgent.h:
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype.completions):
+        (WebInspector.ConsoleView.prototype.evalInInspectedWindow):
+        (WebInspector.ConsoleView.prototype._enterKeyPressed):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame.updatingCallbackWrapper):
+        (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._showPopup):
+        * inspector/front-end/WatchExpressionsSidebarPane.js:
+        (WebInspector.WatchExpressionsSection.prototype.update):
+
 2011-01-26  Hironori Bono  <hbono@chromium.org>
 
         Reviewed by Kent Tamura.
index 1969f3430e14566f7d14b2f069dfe3204fd8f9a2..9fd606bcde0a970a0926096afff9bd3c4825622f 100644 (file)
@@ -44,20 +44,22 @@ InjectedScript::InjectedScript(ScriptObject injectedScriptObject)
 {
 }
 
-void InjectedScript::evaluate(const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
+void InjectedScript::evaluate(const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorValue>* result)
 {
     ScriptFunctionCall function(m_injectedScriptObject, "evaluate");
     function.appendArgument(expression);
     function.appendArgument(objectGroup);
+    function.appendArgument(includeCommandLineAPI);
     makeCall(function, result);
 }
 
-void InjectedScript::evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
+void InjectedScript::evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorValue>* result)
 {
     ScriptFunctionCall function(m_injectedScriptObject, "evaluateOnCallFrame");
     function.appendArgument(callFrameId->toJSONString());
     function.appendArgument(expression);
     function.appendArgument(objectGroup);
+    function.appendArgument(includeCommandLineAPI);
     makeCall(function, result);
 }
 
@@ -69,20 +71,20 @@ void InjectedScript::evaluateOnSelf(const String& functionBody, PassRefPtr<Inspe
     makeCall(function, result);
 }
 
-void InjectedScript::getCompletions(const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result)
+void InjectedScript::getCompletions(const String& expression, bool includeCommandLineAPI, RefPtr<InspectorValue>* result)
 {
     ScriptFunctionCall function(m_injectedScriptObject, "getCompletions");
     function.appendArgument(expression);
-    function.appendArgument(includeInspectorCommandLineAPI);
+    function.appendArgument(includeCommandLineAPI);
     makeCall(function, result);
 }
 
-void InjectedScript::getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result)
+void InjectedScript::getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeCommandLineAPI, RefPtr<InspectorValue>* result)
 {
     ScriptFunctionCall function(m_injectedScriptObject, "getCompletionsOnCallFrame");
     function.appendArgument(callFrameId->toJSONString());
     function.appendArgument(expression);
-    function.appendArgument(includeInspectorCommandLineAPI);
+    function.appendArgument(includeCommandLineAPI);
     makeCall(function, result);
 }
 
index 0a3f24b9c3a8cf999252a6c3d1ce2c14861b6c33..0dd41aef91a62134849ec1c6fbf5be5b61887b70 100644 (file)
@@ -50,11 +50,11 @@ public:
 
     bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); }
 
-    void evaluate(const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
-    void evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
+    void evaluate(const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorValue>* result);
+    void evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorValue>* result);
     void evaluateOnSelf(const String& functionBody, PassRefPtr<InspectorArray> argumentsArray, RefPtr<InspectorValue>* result);
-    void getCompletions(const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result);
-    void getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result);
+    void getCompletions(const String& expression, bool includeCommandLineAPI, RefPtr<InspectorValue>* result);
+    void getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeCommandLineAPI, RefPtr<InspectorValue>* result);
     void getProperties(PassRefPtr<InspectorObject> objectId, bool ignoreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result);
     void pushNodeToFrontend(PassRefPtr<InspectorObject> objectId, RefPtr<InspectorValue>* result);
     void resolveNode(long nodeId, RefPtr<InspectorValue>* result);
index 3aa24a6a2cb1be7a8086ab3a87dfe385e0af9017..050b58217f34cf7c8f33b37ceb2ac9fbc52ff9b7 100644 (file)
@@ -186,18 +186,18 @@ InjectedScript.prototype = {
         return Object.keys(propertyNameSet);
     },
 
-    getCompletions: function(expression, includeInspectorCommandLineAPI)
+    getCompletions: function(expression, includeCommandLineAPI)
     {
         var props = {};
         try {
             if (!expression)
                 expression = "this";
-            var expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false);
+            var expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false, false);
 
             if (typeof expressionResult === "object")
                 this._populatePropertyNames(expressionResult, props);
     
-            if (includeInspectorCommandLineAPI) {
+            if (includeCommandLineAPI) {
                 for (var prop in this._commandLineAPI)
                     props[prop] = true;
             }
@@ -206,7 +206,7 @@ InjectedScript.prototype = {
         return props;
     },
 
-    getCompletionsOnCallFrame: function(callFrameId, expression, includeInspectorCommandLineAPI)
+    getCompletionsOnCallFrame: function(callFrameId, expression, includeCommandLineAPI)
     {
         var props = {};
         try {
@@ -215,7 +215,7 @@ InjectedScript.prototype = {
                 return props;
 
             if (expression) {
-                var expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression, true);
+                var expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression, true, false);
                 if (typeof expressionResult === "object")
                     this._populatePropertyNames(expressionResult, props);
             } else {
@@ -225,7 +225,7 @@ InjectedScript.prototype = {
                     this._populatePropertyNames(scopeChain[i], props);
             }
     
-            if (includeInspectorCommandLineAPI) {
+            if (includeCommandLineAPI) {
                 for (var prop in this._commandLineAPI)
                     props[prop] = true;
             }
@@ -234,21 +234,21 @@ InjectedScript.prototype = {
         return props;
     },
 
-    evaluate: function(expression, objectGroup)
+    evaluate: function(expression, objectGroup, injectCommandLineAPI)
     {
-        return this._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup, false);
+        return this._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup, false, injectCommandLineAPI);
     },
 
-    _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, isEvalOnCallFrame)
+    _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, isEvalOnCallFrame, injectCommandLineAPI)
     {
         try {
-            return this._wrapObject(this._evaluateOn(evalFunction, object, expression, isEvalOnCallFrame), objectGroup);
+            return this._wrapObject(this._evaluateOn(evalFunction, object, expression, isEvalOnCallFrame, injectCommandLineAPI), objectGroup);
         } catch (e) {
             return InjectedScript.RemoteObject.fromException(e);
         }
     },
 
-    _evaluateOn: function(evalFunction, object, expression, isEvalOnCallFrame)
+    _evaluateOn: function(evalFunction, object, expression, isEvalOnCallFrame, injectCommandLineAPI)
     {
         // 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
@@ -258,7 +258,8 @@ InjectedScript.prototype = {
         // 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 ? window.console._commandLineAPI : {}) {\n" + expression + "\n}";
+        if (injectCommandLineAPI)
+            expression = "with (window ? window.console._commandLineAPI : {}) {\n" + expression + "\n}";
         var value = evalFunction.call(object, expression);
     
         delete inspectedWindow.console._commandLineAPI;
@@ -291,12 +292,12 @@ InjectedScript.prototype = {
         return result;
     },
 
-    evaluateOnCallFrame: function(callFrameId, code, objectGroup)
+    evaluateOnCallFrame: function(callFrameId, expression, objectGroup, injectCommandLineAPI)
     {
         var callFrame = this._callFrameForId(callFrameId);
         if (!callFrame)
             return false;
-        return this._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup, true);
+        return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression, objectGroup, true, injectCommandLineAPI);
     },
 
     _callFrameForId: function(callFrameId)
index a91765f43bd1023a18bd449c92ee1d0a14164de5..b8ccd8e11f16864044a47bc9d80e766b6b8a04e6 100644 (file)
@@ -71,8 +71,8 @@ module core {
         // Runtime
         ///////////////////////////////////////////////////////////////////////
 
-        [domain=Runtime] void evaluate(in String expression, in String objectGroup, out Value result);
-        [domain=Runtime] void getCompletions(in String expression, in boolean includeInspectorCommandLineAPI, out Value result);
+        [domain=Runtime] void evaluate(in String expression, in String objectGroup, in boolean includeCommandLineAPI, out Value result);
+        [domain=Runtime] void getCompletions(in String expression, in boolean includeCommandLineAPI, out Value result);
         [domain=Runtime] void getProperties(in Object objectId, in boolean ignoreHasOwnProperty, in boolean abbreviate, out Value result);
         [domain=Runtime] void setPropertyValue(in Object objectId, in String propertyName, in String expression, out Value result);
         [domain=Runtime] void releaseWrapperObjectGroup(in long injectedScriptId, in String objectGroup);
@@ -276,8 +276,8 @@ module core {
 
         [domain=Debugger] void setPauseOnExceptionsState(in long pauseOnExceptionsState, out long newState);
 
-        [domain=Debugger] void evaluateOnCallFrame(in Object callFrameId, in String expression, in String objectGroup, out Value result);
-        [domain=Debugger] void getCompletionsOnCallFrame(in Object callFrameId, in String expression, in boolean includeInspectorCommandLineAPI, out Value result);
+        [domain=Debugger] void evaluateOnCallFrame(in Object callFrameId, in String expression, in String objectGroup, in boolean includeCommandLineAPI, out Value result);
+        [domain=Debugger] void getCompletionsOnCallFrame(in Object callFrameId, in String expression, in boolean includeCommandLineAPI, out Value result);
 
         [notify, domain=Debugger] void breakpointResolved(out String breakpointId, out Object breakpoint);
 
index 600e44f05f2fc02220a9c98768eba6443446d899..9f3cce8c7f499dcbf3617c18f5668760f62d50fa 100644 (file)
@@ -249,18 +249,18 @@ void InspectorDebuggerAgent::setPauseOnExceptionsState(long pauseState, long* ne
     *newState = ScriptDebugServer::shared().pauseOnExceptionsState();
 }
 
-void InspectorDebuggerAgent::evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
+void InspectorDebuggerAgent::evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorValue>* result)
 {
     InjectedScript injectedScript = m_inspectorAgent->injectedScriptHost()->injectedScriptForObjectId(callFrameId.get());
     if (!injectedScript.hasNoValue())
-        injectedScript.evaluateOnCallFrame(callFrameId, expression, objectGroup, result);
+        injectedScript.evaluateOnCallFrame(callFrameId, expression, objectGroup, includeCommandLineAPI, result);
 }
 
-void InspectorDebuggerAgent::getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result)
+void InspectorDebuggerAgent::getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeCommandLineAPI, RefPtr<InspectorValue>* result)
 {
     InjectedScript injectedScript = m_inspectorAgent->injectedScriptHost()->injectedScriptForObjectId(callFrameId.get());
     if (!injectedScript.hasNoValue())
-        injectedScript.getCompletionsOnCallFrame(callFrameId, expression, includeInspectorCommandLineAPI, result);
+        injectedScript.getCompletionsOnCallFrame(callFrameId, expression, includeCommandLineAPI, result);
 }
 
 PassRefPtr<InspectorValue> InspectorDebuggerAgent::currentCallFrames()
index 29f45ded7b14f2106f158c43abcafba24b6f245e..34ad0dbf06780b1a447864059582127adcc57dc1 100644 (file)
@@ -82,8 +82,8 @@ public:
     void stepInto();
     void stepOut();
     void setPauseOnExceptionsState(long pauseState, long* newState);
-    void evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
-    void getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result);
+    void evaluateOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorValue>* result);
+    void getCompletionsOnCallFrame(PassRefPtr<InspectorObject> callFrameId, const String& expression, bool includeCommandLineAPI, RefPtr<InspectorValue>* result);
 
 private:
     InspectorDebuggerAgent(InspectorAgent*, InspectorFrontend*);
index 0502437e2e6f5f37351c85ef5dc25883ace7a54c..7938afdc7784171f9c91fb1c67701bbbeadec581 100644 (file)
@@ -45,18 +45,18 @@ InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptHost* injectedScriptH
 
 InspectorRuntimeAgent::~InspectorRuntimeAgent() { }
 
-void InspectorRuntimeAgent::evaluate(const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result)
+void InspectorRuntimeAgent::evaluate(const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorValue>* result)
 {
     InjectedScript injectedScript = m_injectedScriptHost->injectedScriptForMainFrame();
     if (!injectedScript.hasNoValue())
-        injectedScript.evaluate(expression, objectGroup, result);
+        injectedScript.evaluate(expression, objectGroup, includeCommandLineAPI, result);
 }
 
-void InspectorRuntimeAgent::getCompletions(const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result)
+void InspectorRuntimeAgent::getCompletions(const String& expression, bool includeCommandLineAPI, RefPtr<InspectorValue>* result)
 {
     InjectedScript injectedScript = m_injectedScriptHost->injectedScriptForMainFrame();
     if (!injectedScript.hasNoValue())
-        injectedScript.getCompletions(expression, includeInspectorCommandLineAPI, result);
+        injectedScript.getCompletions(expression, includeCommandLineAPI, result);
 }
 
 void InspectorRuntimeAgent::getProperties(PassRefPtr<InspectorObject> objectId, bool ignoreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result)
index 3ac2eed9786d3cc20cc502b80011064e1022150c..9fb2716fff335286f37d1ca364d3fd5252006135 100644 (file)
@@ -57,8 +57,8 @@ public:
     ~InspectorRuntimeAgent();
 
     // Part of the protocol.
-    void evaluate(const String& expression, const String& objectGroup, RefPtr<InspectorValue>* result);
-    void getCompletions(const String& expression, bool includeInspectorCommandLineAPI, RefPtr<InspectorValue>* result);
+    void evaluate(const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorValue>* result);
+    void getCompletions(const String& expression, bool includeCommandLineAPI, RefPtr<InspectorValue>* result);
     void getProperties(PassRefPtr<InspectorObject> objectId, bool ignoreHasOwnProperty, bool abbreviate, RefPtr<InspectorValue>* result);
     void setPropertyValue(PassRefPtr<InspectorObject> objectId, const String& propertyName, const String& expression, RefPtr<InspectorValue>* result);
     void releaseWrapperObjectGroup(long injectedScriptId, const String& objectGroup);
index bd08e60aba294d7a96e3adf051635ce05e111f23..7feb7ab978124050e5f5d5e9dfb9d484dea02bfc 100644 (file)
@@ -359,12 +359,12 @@ WebInspector.ConsoleView.prototype = {
         var reportCompletions = this._reportCompletions.bind(this, bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix);
         // Collect comma separated object properties for the completion.
 
-        var includeInspectorCommandLineAPI = (!dotNotation && !bracketNotation);
+        var includeCommandLineAPI = (!dotNotation && !bracketNotation);
         var injectedScriptAccess;
         if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused)
-            InspectorBackend.getCompletionsOnCallFrame(WebInspector.panels.scripts.selectedCallFrameId(), expressionString, includeInspectorCommandLineAPI, reportCompletions);
+            InspectorBackend.getCompletionsOnCallFrame(WebInspector.panels.scripts.selectedCallFrameId(), expressionString, includeCommandLineAPI, reportCompletions);
         else
-            InspectorBackend.getCompletions(expressionString, includeInspectorCommandLineAPI, reportCompletions);
+            InspectorBackend.getCompletions(expressionString, includeCommandLineAPI, reportCompletions);
     },
 
     _reportCompletions: function(bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix, result, isException) {
@@ -510,17 +510,13 @@ WebInspector.ConsoleView.prototype = {
         }
     },
 
-    evalInInspectedWindow: function(expression, objectGroup, callback)
+    evalInInspectedWindow: function(expression, objectGroup, includeCommandLineAPI, callback)
     {
         if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused) {
-            WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, objectGroup, callback);
+            WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, objectGroup, includeCommandLineAPI, callback);
             return;
         }
-        this.doEvalInWindow(expression, objectGroup, callback);
-    },
 
-    doEvalInWindow: function(expression, objectGroup, callback)
-    {
         if (!expression) {
             // There is no expression, so the completion should happen against global properties.
             expression = "this";
@@ -530,7 +526,7 @@ WebInspector.ConsoleView.prototype = {
         {
             callback(WebInspector.RemoteObject.fromPayload(result));
         }
-        InspectorBackend.evaluate(expression, objectGroup, evalCallback);
+        InspectorBackend.evaluate(expression, objectGroup, includeCommandLineAPI, evalCallback);
     },
 
     _enterKeyPressed: function(event)
@@ -561,7 +557,7 @@ WebInspector.ConsoleView.prototype = {
 
             self.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));
         }
-        this.evalInInspectedWindow(str, "console", printResult);
+        this.evalInInspectedWindow(str, "console", true, printResult);
     },
 
     _format: function(output, forceObjectFormat)
index fdcce37c6cd10a1d0e22c7d6d4354a3d1eec89df..6f2291d56b541c52a8b1ebd1b0bf0b65ef43ba76 100644 (file)
@@ -314,7 +314,7 @@ WebInspector.ScriptsPanel.prototype = {
         return selectedCallFrame.id;
     },
 
-    evaluateInSelectedCallFrame: function(code, updateInterface, objectGroup, callback)
+    evaluateInSelectedCallFrame: function(code, updateInterface, objectGroup, includeCommandLineAPI, callback)
     {
         var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame;
         if (!this._paused || !selectedCallFrame)
@@ -323,24 +323,15 @@ WebInspector.ScriptsPanel.prototype = {
         if (typeof updateInterface === "undefined")
             updateInterface = true;
 
-        var self = this;
         function updatingCallbackWrapper(result)
         {
-            callback(result);
-            if (updateInterface)
-                self.sidebarPanes.scopechain.update(selectedCallFrame);
-        }
-        this.doEvalInCallFrame(selectedCallFrame, code, objectGroup, updatingCallbackWrapper);
-    },
-
-    doEvalInCallFrame: function(callFrame, code, objectGroup, callback)
-    {
-        function evalCallback(result)
-        {
-            if (result)
+            if (result) {
                 callback(WebInspector.RemoteObject.fromPayload(result));
+                if (updateInterface)
+                    this.sidebarPanes.scopechain.update(selectedCallFrame);
+            }
         }
-        InspectorBackend.evaluateOnCallFrame(callFrame.id, code, objectGroup, evalCallback);
+        InspectorBackend.evaluateOnCallFrame(selectedCallFrame.id, code, objectGroup, includeCommandLineAPI, updatingCallbackWrapper.bind(this));
     },
 
     _debuggerPaused: function(event)
index ce3531faaf280f47b2e593077885a25745144f9d..821074a3d21dc48304569e7caca4b5b198116a7e 100644 (file)
@@ -759,7 +759,7 @@ WebInspector.SourceFrame.prototype = {
                 return;
             showObjectPopup.call(this, result);
         }
-        WebInspector.panels.scripts.evaluateInSelectedCallFrame(element.textContent, false, this._popoverObjectGroup, evaluateCallback.bind(this));
+        WebInspector.panels.scripts.evaluateInSelectedCallFrame(element.textContent, false, this._popoverObjectGroup, false, evaluateCallback.bind(this));
     },
 
     _editBreakpointCondition: function(lineNumber, condition, callback)
index a01046b33cf54de7429038cd11a13c295dfa9382..a6f59ca5f8fb7574730a6e3e4958579c40ed2b55 100644 (file)
@@ -139,7 +139,7 @@ WebInspector.WatchExpressionsSection.prototype = {
             if (!expression)
                 continue;
 
-            WebInspector.console.evalInInspectedWindow("(" + expression + ")", this._watchObjectGroupId, appendResult.bind(this, expression, i));
+            WebInspector.console.evalInInspectedWindow("(" + expression + ")", this._watchObjectGroupId, false, appendResult.bind(this, expression, i));
         }
 
         // note this is setting the expansion of the tree, not the section;