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

Unified Diff: src/isolate.cc

Issue 2361333003: Fix crash from turning on DevTools in the middle of catch prediction (Closed)
Patch Set: Simplify code in ASYNC_AWAIT case of GetPromiseOnStackOnThrow Created 4 years, 3 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/harmony/async-debug-caught-exception.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 01d9b0df1d7ae8ba6a5425955b0092cc3723ad9a..bd607e2f3712c03a7f071a884fd5c355684c4912 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1751,13 +1751,16 @@ Handle<Object> Isolate::GetPromiseOnStackOnThrow() {
}
return retval;
case HandlerTable::PROMISE:
- return promise_on_stack->promise();
+ return promise_on_stack
+ ? Handle<Object>::cast(promise_on_stack->promise())
+ : undefined;
case HandlerTable::ASYNC_AWAIT: {
// If in the initial portion of async/await, continue the loop to pop up
// successive async/await stack frames until an asynchronous one with
// dependents is found, or a non-async stack frame is encountered, in
// order to handle the synchronous async/await catch prediction case:
// assume that async function calls are awaited.
+ if (!promise_on_stack) return retval;
retval = promise_on_stack->promise();
if (PromiseHasUserDefinedRejectHandler(retval)) {
return retval;
« no previous file with comments | « no previous file | test/mjsunit/harmony/async-debug-caught-exception.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698