diff --git a/chromium/v8/src/execution/isolate.cc b/chromium/v8/src/execution/isolate.cc index e7232e5c1fd..71d8d64a682 100644 --- a/chromium/v8/src/execution/isolate.cc +++ b/chromium/v8/src/execution/isolate.cc @@ -1020,7 +1020,13 @@ void CaptureAsyncStackTrace(Isolate* isolate, Handle promise, isolate); builder->AppendPromiseCombinatorFrame(function, combinator); - // Now peak into the Promise.all() resolve element context to + if (IsNativeContext(*context)) { + // NativeContext is used as a marker that the closure was already + // called. We can't access the reject element context any more. + return; + } + + // Now peek into the Promise.all() resolve element context to // find the promise capability that's being resolved when all // the concurrent promises resolve. int const index = @@ -1039,7 +1045,13 @@ void CaptureAsyncStackTrace(Isolate* isolate, Handle promise, context->native_context()->promise_all_settled(), isolate); builder->AppendPromiseCombinatorFrame(function, combinator); - // Now peak into the Promise.allSettled() resolve element context to + if (IsNativeContext(*context)) { + // NativeContext is used as a marker that the closure was already + // called. We can't access the reject element context any more. + return; + } + + // Now peek into the Promise.allSettled() resolve element context to // find the promise capability that's being resolved when all // the concurrent promises resolve. int const index = @@ -1057,7 +1069,12 @@ void CaptureAsyncStackTrace(Isolate* isolate, Handle promise, isolate); builder->AppendPromiseCombinatorFrame(function, combinator); - // Now peak into the Promise.any() reject element context to + if (IsNativeContext(*context)) { + // NativeContext is used as a marker that the closure was already + // called. We can't access the reject element context any more. + return; + } + // Now peek into the Promise.any() reject element context to // find the promise capability that's being resolved when any of // the concurrent promises resolve. int const index = PromiseBuiltins::kPromiseAnyRejectElementCapabilitySlot;