mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
d4a80aa2c4
42 changed files with 538 additions and 364 deletions
|
|
@ -100,6 +100,10 @@ class PromiseObject : public NativeObject
|
|||
int32_t flags = getFixedSlot(PromiseSlot_Flags).toInt32();
|
||||
setFixedSlot(PromiseSlot_Flags, Int32Value(flags | PROMISE_FLAG_REPORTED));
|
||||
}
|
||||
bool isReported() {
|
||||
MOZ_ASSERT(isUnhandled());
|
||||
return flags() & PROMISE_FLAG_REPORTED;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4949,12 +4949,31 @@ JS::GetPromiseResult(JS::HandleObject promiseObj)
|
|||
return promise->state() == JS::PromiseState::Fulfilled ? promise->value() : promise->reason();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS::GetPromiseIsHandled(JS::HandleObject promise)
|
||||
{
|
||||
PromiseObject* promiseObj = &promise->as<PromiseObject>();
|
||||
return !promiseObj->isUnhandled();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS::GetPromiseAllocationSite(JS::HandleObject promise)
|
||||
{
|
||||
return promise->as<PromiseObject>().allocationSite();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS::GetPromiseIsReported(JS::HandleObject promise)
|
||||
{
|
||||
return promise->as<PromiseObject>().isReported();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS::MarkPromiseRejectionReported(JS::HandleObject promise)
|
||||
{
|
||||
return promise->as<PromiseObject>().markAsReported();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSObject*)
|
||||
JS::GetPromiseResolutionSite(JS::HandleObject promise)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4611,6 +4611,27 @@ GetPromiseID(JS::HandleObject promise);
|
|||
extern JS_PUBLIC_API(JS::Value)
|
||||
GetPromiseResult(JS::HandleObject promise);
|
||||
|
||||
/**
|
||||
* Returns whether the given promise's rejection is already handled or not.
|
||||
*
|
||||
* The caller must check the given promise is rejected before checking it's
|
||||
* handled or not.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
GetPromiseIsHandled(JS::HandleObject promise);
|
||||
|
||||
/**
|
||||
* Returns whether the given promise's rejection is reported or not.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
GetPromiseIsReported(JS::HandleObject promise);
|
||||
|
||||
/**
|
||||
* Mark the given promise's rejection as already reported.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
MarkPromiseRejectionReported(JS::HandleObject promise);
|
||||
|
||||
/**
|
||||
* Returns a js::SavedFrame linked list of the stack that lead to the given
|
||||
* Promise's allocation.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue