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

Unified Diff: src/isolate.cc

Issue 2203803002: [debug] Don't notify listener of exceptions internal to a desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 4 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 | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index cc8c8b6739f2fd6b9739dbc98e699e693d5bcc62..58324304cf6d083240d37220e5236ee39657c8ce 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1142,8 +1142,9 @@ Object* Isolate::Throw(Object* exception, MessageLocation* location) {
// embedder didn't specify a custom uncaught exception callback,
// or if the custom callback determined that V8 should abort, then
// abort.
+ CatchType prediction = PredictExceptionCatcher();
if (FLAG_abort_on_uncaught_exception &&
- PredictExceptionCatcher() != CAUGHT_BY_JAVASCRIPT &&
+ (prediction == NOT_CAUGHT || prediction == CAUGHT_BY_EXTERNAL) &&
(!abort_on_uncaught_exception_callback_ ||
abort_on_uncaught_exception_callback_(
reinterpret_cast<v8::Isolate*>(this)))) {
@@ -1339,9 +1340,9 @@ Isolate::CatchType Isolate::PredictExceptionCatcher() {
// For JavaScript frames we perform a lookup in the handler table.
if (frame->is_java_script()) {
JavaScriptFrame* js_frame = static_cast<JavaScriptFrame*>(frame);
- if (PredictException(js_frame) != HandlerTable::UNCAUGHT) {
- return CAUGHT_BY_JAVASCRIPT;
- }
+ HandlerTable::CatchPrediction prediction = PredictException(js_frame);
+ if (prediction == HandlerTable::DESUGARING) return CAUGHT_BY_DESUGARING;
+ if (prediction != HandlerTable::UNCAUGHT) return CAUGHT_BY_JAVASCRIPT;
}
// The exception has been externally caught if and only if there is an
@@ -1750,12 +1751,16 @@ Handle<Object> Isolate::GetPromiseOnStackOnThrow() {
ThreadLocalTop* tltop = thread_local_top();
if (tltop->promise_on_stack_ == NULL) return undefined;
// Find the top-most try-catch or try-finally handler.
- if (PredictExceptionCatcher() != CAUGHT_BY_JAVASCRIPT) return undefined;
+ CatchType prediction = PredictExceptionCatcher();
+ if (prediction == NOT_CAUGHT || prediction == CAUGHT_BY_EXTERNAL) {
+ return undefined;
+ }
for (JavaScriptFrameIterator it(this); !it.done(); it.Advance()) {
switch (PredictException(it.frame())) {
case HandlerTable::UNCAUGHT:
break;
case HandlerTable::CAUGHT:
+ case HandlerTable::DESUGARING:
return undefined;
case HandlerTable::PROMISE:
return tltop->promise_on_stack_->promise();
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698