// j. Let steps be the algorithm steps defined in Promise.all Resolve Element Functions.
// k. Let length be the number of non-optional parameters of the function definition in Promise.all Resolve Element Functions.
// l. Let onFulfilled be CreateBuiltinFunction(steps, length, "", « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
// m. Set onFulfilled.[[AlreadyCalled]] to false.
// n. Set onFulfilled.[[Index]] to index.
// o. Set onFulfilled.[[Values]] to values.
// p. Set onFulfilled.[[Capability]] to resultCapability.
// q. Set onFulfilled.[[RemainingElements]] to remainingElementsCount.
// e. Let steps be the algorithm steps defined in Promise.all Resolve Element Functions.
// f. Let length be the number of non-optional parameters of the function definition in Promise.all Resolve Element Functions.
// g. Let onFulfilled be CreateBuiltinFunction(steps, length, "", « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
// h. Set onFulfilled.[[AlreadyCalled]] to false.
// i. Set onFulfilled.[[Index]] to index.
// j. Set onFulfilled.[[Values]] to values.
// k. Set onFulfilled.[[Capability]] to resultCapability.
// l. Set onFulfilled.[[RemainingElements]] to remainingElementsCount.
leton_fulfilled=FunctionObjectBuilder::new(
context.realm(),
NativeFunction::from_copy_closure_with_captures(
@ -761,10 +732,10 @@ impl Promise {
.constructor(false)
.build();
// r. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] + 1.
// m. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] + 1.
// j. Let stepsFulfilled be the algorithm steps defined in Promise.allSettled Resolve Element Functions.
// k. Let lengthFulfilled be the number of non-optional parameters of the function definition in Promise.allSettled Resolve Element Functions.
// l. Let onFulfilled be CreateBuiltinFunction(stepsFulfilled, lengthFulfilled, "", « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
// m. Let alreadyCalled be the Record { [[Value]]: false }.
// n. Set onFulfilled.[[AlreadyCalled]] to alreadyCalled.
// o. Set onFulfilled.[[Index]] to index.
// p. Set onFulfilled.[[Values]] to values.
// q. Set onFulfilled.[[Capability]] to resultCapability.
// r. Set onFulfilled.[[RemainingElements]] to remainingElementsCount.
// e. Let stepsFulfilled be the algorithm steps defined in Promise.allSettled Resolve Element Functions.
// f. Let lengthFulfilled be the number of non-optional parameters of the function definition in Promise.allSettled Resolve Element Functions.
// g. Let onFulfilled be CreateBuiltinFunction(stepsFulfilled, lengthFulfilled, "", « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
// h. Let alreadyCalled be the Record { [[Value]]: false }.
// i. Set onFulfilled.[[AlreadyCalled]] to alreadyCalled.
// j. Set onFulfilled.[[Index]] to index.
// k. Set onFulfilled.[[Values]] to values.
// l. Set onFulfilled.[[Capability]] to resultCapability.
// m. Set onFulfilled.[[RemainingElements]] to remainingElementsCount.
leton_fulfilled=FunctionObjectBuilder::new(
context.realm(),
NativeFunction::from_copy_closure_with_captures(
@ -1010,14 +968,14 @@ impl Promise {
.constructor(false)
.build();
// s. Let stepsRejected be the algorithm steps defined in Promise.allSettled Reject Element Functions.
// t. Let lengthRejected be the number of non-optional parameters of the function definition in Promise.allSettled Reject Element Functions.
// u. Let onRejected be CreateBuiltinFunction(stepsRejected, lengthRejected, "", « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
// v. Set onRejected.[[AlreadyCalled]] to alreadyCalled.
// w. Set onRejected.[[Index]] to index.
// x. Set onRejected.[[Values]] to values.
// y. Set onRejected.[[Capability]] to resultCapability.
// z. Set onRejected.[[RemainingElements]] to remainingElementsCount.
// n. Let stepsRejected be the algorithm steps defined in Promise.allSettled Reject Element Functions.
// o. Let lengthRejected be the number of non-optional parameters of the function definition in Promise.allSettled Reject Element Functions.
// p. Let onRejected be CreateBuiltinFunction(stepsRejected, lengthRejected, "", « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
// q. Set onRejected.[[AlreadyCalled]] to alreadyCalled.
// r. Set onRejected.[[Index]] to index.
// s. Set onRejected.[[Values]] to values.
// t. Set onRejected.[[Capability]] to resultCapability.
// u. Set onRejected.[[RemainingElements]] to remainingElementsCount.
leton_rejected=FunctionObjectBuilder::new(
context.realm(),
NativeFunction::from_copy_closure_with_captures(
@ -1100,19 +1058,40 @@ impl Promise {
.constructor(false)
.build();
// aa. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] + 1.
// v. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] + 1.
// j. Let stepsRejected be the algorithm steps defined in Promise.any Reject Element Functions.
// k. Let lengthRejected be the number of non-optional parameters of the function definition in Promise.any Reject Element Functions.
// l. Let onRejected be CreateBuiltinFunction(stepsRejected, lengthRejected, "", « [[AlreadyCalled]], [[Index]], [[Errors]], [[Capability]], [[RemainingElements]] »).
// m. Set onRejected.[[AlreadyCalled]] to false.
// n. Set onRejected.[[Index]] to index.
// o. Set onRejected.[[Errors]] to errors.
// p. Set onRejected.[[Capability]] to resultCapability.
// q. Set onRejected.[[RemainingElements]] to remainingElementsCount.
// e. Let stepsRejected be the algorithm steps defined in Promise.any Reject Element Functions.
// f. Let lengthRejected be the number of non-optional parameters of the function definition in Promise.any Reject Element Functions.
// g. Let onRejected be CreateBuiltinFunction(stepsRejected, lengthRejected, "", « [[AlreadyCalled]], [[Index]], [[Errors]], [[Capability]], [[RemainingElements]] »).
// h. Set onRejected.[[AlreadyCalled]] to false.
// i. Set onRejected.[[Index]] to index.
// j. Set onRejected.[[Errors]] to errors.
// k. Set onRejected.[[Capability]] to resultCapability.
// l. Set onRejected.[[RemainingElements]] to remainingElementsCount.
leton_rejected=FunctionObjectBuilder::new(
context.realm(),
NativeFunction::from_copy_closure_with_captures(
@ -1336,10 +1279,10 @@ impl Promise {
.constructor(false)
.build();
// r. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] + 1.
// m. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] + 1.