| Index: third_party/WebKit/Source/devtools/front_end/console_model/ConsoleModel.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/console_model/ConsoleModel.js b/third_party/WebKit/Source/devtools/front_end/console_model/ConsoleModel.js
|
| index 4e64cf59f0557a40edef90c5f443b39baa76e4af..3d31a8eb44f39b86171cc143b7c34692b546339f 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/console_model/ConsoleModel.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/console_model/ConsoleModel.js
|
| @@ -148,32 +148,7 @@ ConsoleModel.ConsoleModel = class extends Common.Object {
|
| });
|
| }
|
|
|
| - /**
|
| - * @param {string} code
|
| - * @suppress {uselessCode}
|
| - * @return {boolean}
|
| - */
|
| - function looksLikeAnObjectLiteral(code) {
|
| - // Only parenthesize what appears to be an object literal.
|
| - if (!(/^\s*\{/.test(code) && /\}\s*$/.test(code)))
|
| - return false;
|
| -
|
| - try {
|
| - // Check if the code can be interpreted as an expression.
|
| - Function('return ' + code + ';');
|
| -
|
| - // No syntax error! Does it work parenthesized?
|
| - Function('(' + code + ')');
|
| -
|
| - return true;
|
| - } catch (e) {
|
| - return false;
|
| - }
|
| - }
|
| -
|
| - if (looksLikeAnObjectLiteral(text))
|
| - text = '(' + text + ')';
|
| -
|
| + text = SDK.RuntimeModel.wrapObjectLiteralExpressionIfNeeded(text);
|
| executionContext.evaluate(text, 'console', useCommandLineAPI, false, false, true, true, printResult.bind(this));
|
| Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConsoleEvaluated);
|
| }
|
|
|