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

Unified Diff: src/isolate.cc

Issue 991833002: Simplify promise event on throw handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | test/mjsunit/es6/debug-promises/resolve-after-aborted-try-finally.js » ('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 9c2d9e5a77c18d3c0c9939e2ee5746c9c39fb78b..dc31fb68692c732ac7b3f322d7b12bcf94ad3ec5 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1555,14 +1555,9 @@ Handle<Object> Isolate::GetPromiseOnStackOnThrow() {
StackHandler* promise_try = tltop->promise_on_stack_->handler();
// Find the top-most try-catch handler.
StackHandler* handler = StackHandler::FromAddress(Isolate::handler(tltop));
- do {
- if (handler == promise_try) {
- return tltop->promise_on_stack_->promise();
- }
- handler = handler->next();
- // Throwing inside a Promise can be intercepted by an inner try-catch, so
- // we stop at the first try-catch handler.
- } while (handler != NULL && !handler->is_catch());
+ // Throwing inside a Promise only leads to a reject if not caught by an inner
+ // try-catch or try-finally.
+ if (handler == promise_try) return tltop->promise_on_stack_->promise();
return undefined;
}
« no previous file with comments | « no previous file | test/mjsunit/es6/debug-promises/resolve-after-aborted-try-finally.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698