From 95d53ffee15e73a6423284bfedb1403c12633d47 Mon Sep 17 00:00:00 2001 From: yangguo Date: Tue, 25 Apr 2017 07:00:56 -0700 Subject: [PATCH] Revert of [d8] console methods must not throw. (patchset #1 id:1 of https://codereview.chromium.org/2838143002/ ) Reason for revert: Breaks no-intl builds. Original issue's description: > [d8] console methods must not throw. > > R=jarin@chromium.org > BUG=chromium:714696 > > Review-Url: https://codereview.chromium.org/2838143002 > Cr-Commit-Position: refs/heads/master@{#44854} > Committed: https://chromium.googlesource.com/v8/v8/+/87b5b53f6f3321ad33b15e686590da7b57df2ff9 TBR=jarin@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:714696 Review-Url: https://codereview.chromium.org/2840853002 Cr-Commit-Position: refs/heads/master@{#44856} --- src/builtins/builtins-console.cc | 2 -- src/d8-console.cc | 6 +++--- test/message/console.js | 2 -- test/message/console.out | 7 ------- test/mjsunit/regress/regress-crbug-714696.js | 8 -------- 5 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 test/mjsunit/regress/regress-crbug-714696.js diff --git a/src/builtins/builtins-console.cc b/src/builtins/builtins-console.cc index a43fe136d0..a021c8a75b 100644 --- a/src/builtins/builtins-console.cc +++ b/src/builtins/builtins-console.cc @@ -45,8 +45,6 @@ namespace internal { if (isolate->console_delegate()) { \ debug::ConsoleCallArguments wrapper(args); \ isolate->console_delegate()->name(wrapper); \ - CHECK(!isolate->has_pending_exception()); \ - CHECK(!isolate->has_scheduled_exception()); \ } \ return isolate->heap()->undefined_value(); \ } diff --git a/src/d8-console.cc b/src/d8-console.cc index e4f81b3c2d..9e0d244e78 100644 --- a/src/d8-console.cc +++ b/src/d8-console.cc @@ -21,7 +21,7 @@ void WriteToFile(FILE* file, Isolate* isolate, if (arg->IsSymbol()) arg = Local::Cast(arg)->Name(); if (!arg->ToString(isolate->GetCurrentContext()).ToLocal(&str_obj)) { - Shell::ReportException(isolate, &try_catch); + try_catch.ReThrow(); return; } @@ -68,7 +68,7 @@ void D8Console::Time(const debug::ConsoleCallArguments& args) { Local label; v8::TryCatch try_catch(isolate_); if (!arg->ToString(isolate_->GetCurrentContext()).ToLocal(&label)) { - Shell::ReportException(isolate_, &try_catch); + try_catch.ReThrow(); return; } v8::String::Utf8Value utf8(label); @@ -94,7 +94,7 @@ void D8Console::TimeEnd(const debug::ConsoleCallArguments& args) { Local label; v8::TryCatch try_catch(isolate_); if (!arg->ToString(isolate_->GetCurrentContext()).ToLocal(&label)) { - Shell::ReportException(isolate_, &try_catch); + try_catch.ReThrow(); return; } v8::String::Utf8Value utf8(label); diff --git a/test/message/console.js b/test/message/console.js index f49ce4c608..ceab02e9a7 100644 --- a/test/message/console.js +++ b/test/message/console.js @@ -21,5 +21,3 @@ console.warn("warn", { toString: () => 2 }); console.error("error"); console.debug("debug"); console.info("info"); - -console.info({ toString: () => {throw new Error("exception");} }) diff --git a/test/message/console.out b/test/message/console.out index 7813ccd025..b32e538941 100644 --- a/test/message/console.out +++ b/test/message/console.out @@ -6,10 +6,3 @@ log more warn 2 debug info -*%(basename)s:25: Error: exception -console.info({ toString: () => {throw new Error("exception");} }) - ^ -Error: exception - at Object.toString (*%(basename)s:25:39) - at console.info () - at *%(basename)s:25:9 diff --git a/test/mjsunit/regress/regress-crbug-714696.js b/test/mjsunit/regress/regress-crbug-714696.js deleted file mode 100644 index 0a911e4778..0000000000 --- a/test/mjsunit/regress/regress-crbug-714696.js +++ /dev/null @@ -1,8 +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. - -new Intl.v8BreakIterator(); -new Intl.DateTimeFormat(); -console.log({ toString: function() { throw 1; }}); -new Intl.v8BreakIterator();