File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -5162,6 +5162,14 @@ JS::GetPromiseResult(JS::HandleObject promiseObj)
5162
5162
return promise->state () == JS::PromiseState::Fulfilled ? promise->value () : promise->reason ();
5163
5163
}
5164
5164
5165
+ JS_PUBLIC_API (bool )
5166
+ JS::GetPromiseIsHandled(JS::HandleObject promiseObj)
5167
+ {
5168
+ PromiseObject* promise = &promiseObj->as <PromiseObject>();
5169
+ MOZ_ASSERT (promise->state () == JS::PromiseState::Rejected);
5170
+ return !promise->isUnhandled ();
5171
+ }
5172
+
5165
5173
JS_PUBLIC_API (JSObject*)
5166
5174
JS::GetPromiseAllocationSite(JS::HandleObject promise)
5167
5175
{
Original file line number Diff line number Diff line change @@ -4390,6 +4390,12 @@ GetPromiseID(JS::HandleObject promise);
4390
4390
extern JS_PUBLIC_API (JS::Value)
4391
4391
GetPromiseResult(JS::HandleObject promise);
4392
4392
4393
+ /* *
4394
+ * Returns thhe given Promise's internal slot of `isHandled`.
4395
+ */
4396
+ extern JS_PUBLIC_API (bool )
4397
+ GetPromiseIsHandled(JS::HandleObject promise);
4398
+
4393
4399
/* *
4394
4400
* Returns a js::SavedFrame linked list of the stack that lead to the given
4395
4401
* Promise's allocation.
You can’t perform that action at this time.
0 commit comments