Index: third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js |
index acc0d6bb1d41cc4f2159694762d48dbc21a71ffd..a814dca6b604a979f096a01c54d0c6eb5dc55165 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js |
@@ -189,7 +189,6 @@ WebInspector.ConsoleModel.prototype = { |
*/ |
WebInspector.ConsoleModel.evaluateCommandInConsole = function(executionContext, text, useCommandLineAPI) |
{ |
- useCommandLineAPI = !!useCommandLineAPI; |
var target = executionContext.target(); |
var commandMessage = new WebInspector.ConsoleMessage(target, WebInspector.ConsoleMessage.MessageSource.JS, null, text, WebInspector.ConsoleMessage.MessageType.Command); |
@@ -213,8 +212,9 @@ WebInspector.ConsoleModel.evaluateCommandInConsole = function(executionContext, |
target.consoleModel.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEvaluated, {result: result, wasThrown: wasThrown, text: text, commandMessage: commandMessage, exceptionDetails: exceptionDetails}); |
} |
} |
- |
- executionContext.evaluate(text, "console", useCommandLineAPI, false, false, true, printResult); |
+ if (/^\s*\{/.test(text) && /\}\s*$/.test(text)) |
+ text = '(' + text + ')'; |
+ executionContext.evaluate(text, "console", !!useCommandLineAPI, false, false, true, printResult); |
WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ConsoleEvaluated); |
} |