From c917ecfe4e71c5dbb41864d3373741d86aef1e39 Mon Sep 17 00:00:00 2001 From: Michael Achenbach Date: Tue, 11 Jul 2017 19:27:29 +0000 Subject: [PATCH] Revert "[inspector] doesn't run user code to stringify console method arg" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 82451d45a74ac0b22003e1277672efaa34ec01a6. Reason for revert: https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/16923 Original change's description: > [inspector] doesn't run user code to stringify console method arg > > Otherwise user code can produce an exception and we will crash. > > R=​jakob@chromium.org > > Bug: chromium:736302 > Change-Id: I078150909b0348a63e8c375b508e34fc4751b4ab > Reviewed-on: https://chromium-review.googlesource.com/565628 > Commit-Queue: Aleksey Kozyatinskiy > Reviewed-by: Jakob Gruber > Cr-Commit-Position: refs/heads/master@{#46566} TBR=kozyatinskiy@chromium.org,jgruber@chromium.org,jakob@chromium.org Change-Id: I6d7e06fad2ab6c1c894c199fe7b3b6afb2930734 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:736302 Reviewed-on: https://chromium-review.googlesource.com/567060 Reviewed-by: Michael Achenbach Commit-Queue: Michael Achenbach Cr-Commit-Position: refs/heads/master@{#46567} --- src/inspector/v8-console.cc | 4 --- .../runtime/regression-736302-expected.txt | 29 ------------------- test/inspector/runtime/regression-736302.js | 18 ------------ 3 files changed, 51 deletions(-) delete mode 100644 test/inspector/runtime/regression-736302-expected.txt delete mode 100644 test/inspector/runtime/regression-736302.js diff --git a/src/inspector/v8-console.cc b/src/inspector/v8-console.cc index 817f141a54..cf4b130e66 100644 --- a/src/inspector/v8-console.cc +++ b/src/inspector/v8-console.cc @@ -112,10 +112,6 @@ class ConsoleHelper { String16 firstArgToString(const String16& defaultValue) { if (m_info.Length() < 1) return defaultValue; v8::Local titleValue; - v8::TryCatch tryCatch(m_context->GetIsolate()); - v8::Isolate::DisallowJavascriptExecutionScope throwJs( - m_context->GetIsolate(), - v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE); if (m_info[0]->IsObject()) { if (!m_info[0].As()->ObjectProtoToString(m_context).ToLocal( &titleValue)) diff --git a/test/inspector/runtime/regression-736302-expected.txt b/test/inspector/runtime/regression-736302-expected.txt deleted file mode 100644 index 468f2b3c18..0000000000 --- a/test/inspector/runtime/regression-736302-expected.txt +++ /dev/null @@ -1,29 +0,0 @@ -crbug.com/736302 -{ - method : Runtime.consoleAPICalled - params : { - args : [ - [0] : { - type : string - value : 1 - } - ] - executionContextId : - stackTrace : { - callFrames : [ - [0] : { - columnNumber : 10 - functionName : - lineNumber : 1 - scriptId : - url : - } - ] - } - timestamp : - type : count - } -} -{ - type : undefined -} diff --git a/test/inspector/runtime/regression-736302.js b/test/inspector/runtime/regression-736302.js deleted file mode 100644 index b21a9f18a3..0000000000 --- a/test/inspector/runtime/regression-736302.js +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -let {session, contextGroup, Protocol} = InspectorTest.start('crbug.com/736302'); - -(async function main() { - Protocol.Runtime.enable(); - Protocol.Runtime.onConsoleAPICalled(InspectorTest.logMessage); - let r = await Protocol.Runtime.evaluate({expression: ` - console.count({ - get [Symbol.toStringTag]() { - throw new Error(); - } - });`}); - InspectorTest.logMessage(r.result.result); - InspectorTest.completeTest(); -})();