mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Issue #1283 - Implement Promise.prototype.finally()
This resolves #1283.
This commit is contained in:
parent
03da6250e7
commit
ff54e6899f
5 changed files with 105 additions and 1 deletions
|
|
@ -2006,6 +2006,13 @@ CommonStaticResolveRejectImpl(JSContext* cx, HandleValue thisVal, HandleValue ar
|
|||
return promise;
|
||||
}
|
||||
|
||||
MOZ_MUST_USE JSObject*
|
||||
js::PromiseResolve(JSContext* cx, HandleObject constructor, HandleValue value)
|
||||
{
|
||||
RootedValue C(cx, ObjectValue(*constructor));
|
||||
return CommonStaticResolveRejectImpl(cx, C, value, ResolveMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* ES2016, 25.4.4.4, Promise.reject.
|
||||
*/
|
||||
|
|
@ -2739,6 +2746,7 @@ CreatePromisePrototype(JSContext* cx, JSProtoKey key)
|
|||
static const JSFunctionSpec promise_methods[] = {
|
||||
JS_SELF_HOSTED_FN("catch", "Promise_catch", 1, 0),
|
||||
JS_FN("then", Promise_then, 2, 0),
|
||||
JS_SELF_HOSTED_FN("finally", "Promise_finally", 1, 0),
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue