Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: Source/WebCore/inspector/InjectedScriptSource.js

Issue 6320021: Merge 76680 - 2011-01-26 Pavel Feldman <pfeldman@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/inspector/InjectedScript.cpp ('k') | Source/WebCore/inspector/Inspector.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/InjectedScriptSource.js
===================================================================
--- Source/WebCore/inspector/InjectedScriptSource.js (revision 76933)
+++ Source/WebCore/inspector/InjectedScriptSource.js (working copy)
@@ -186,18 +186,18 @@
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 @@
return props;
},
- getCompletionsOnCallFrame: function(callFrameId, expression, includeInspectorCommandLineAPI)
+ getCompletionsOnCallFrame: function(callFrameId, expression, includeCommandLineAPI)
{
var props = {};
try {
@@ -215,7 +215,7 @@
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 @@
this._populatePropertyNames(scopeChain[i], props);
}
- if (includeInspectorCommandLineAPI) {
+ if (includeCommandLineAPI) {
for (var prop in this._commandLineAPI)
props[prop] = true;
}
@@ -234,21 +234,21 @@
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 @@
// 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 @@
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)
« no previous file with comments | « Source/WebCore/inspector/InjectedScript.cpp ('k') | Source/WebCore/inspector/Inspector.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698