|
|
|
6. Let values be F .[[Values]]. 7. Let promiseCapability be F .[[Capability]]. 8. Let remainingElementsCount be F .[[RemainingElements]]. 9. Let obj be ! ( 10. Perform ! ( obj , "status" , "rejected" ). 11. Perform ! ( obj , "reason" , x ). 12. Set values [ index ] to obj . 13. Set remainingElementsCount .[[Value]] to remainingElementsCount .[[Value]] - 1. 14. If remainingElementsCount .[[Value]] is 0, then a. Let valuesArray ( values ). b. Return ? ( promiseCapability .[[Resolve]], undefined , « valuesArray »). 15. Return undefined . The "length" property of a Promise.allSettled Promise.allSettled reject element function is 1 𝔽 . The any any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError AggregateError holding the rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm. 1. Let C be the this value. 2. Let promiseCapability C ). 3. Let promiseResolve be ( C ). 4. ( promiseResolve , promiseCapability ). 5. Let iteratorRecord ( iterable ). 6. ( iteratorRecord , promiseCapability ). 7. Let result iteratorRecord , C , promiseCapability , promiseResolve ). 8. If result , then a. If iteratorRecord .[[Done]] is false , set result to ( iteratorRecord , result ). b. ( result , promiseCapability ). 9. Return ( result ). NOTE The abstract operation PerformPromiseAny takes arguments iteratorRecord , constructor , resultCapability (a promiseResolve . It performs the following steps when called: 1. ( constructor ) is true . 2. ( promiseResolve ) is true . 3. Let errors . 4. Let remainingElementsCount { [[Value]]: 1 }. 5. Let index be 0. 6. Repeat, a. Let next be ( iteratorRecord ). The any any function requires its this function that supports the parameter conventions of the Promise Promise
27.2.4.3 Promise.any ( iterable ) 27.2.4.3.1 PerformPromiseAny ( iteratorRecord , constructor , resultCapability , promiseResolve ) 768 |