Issue #2089 - Implement the Promise.any combinator

Based-on: m-c 1568903/9,1560300
This commit is contained in:
Martok 2023-01-27 20:44:09 +01:00 committed by roytam1
commit f75e9d9441
9 changed files with 577 additions and 50 deletions

View file

@ -356,6 +356,16 @@ intrinsic_ThrowSyntaxError(JSContext* cx, unsigned argc, Value* vp)
return false;
}
static bool
intrinsic_ThrowAggregateError(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() >= 1);
ThrowErrorWithType(cx, JSEXN_AGGREGATEERR, args);
return false;
}
static bool
intrinsic_ThrowInternalError(JSContext* cx, unsigned argc, Value* vp)
{
@ -2223,6 +2233,7 @@ static const JSFunctionSpec intrinsic_functions[] = {
JS_FN("ThrowRangeError", intrinsic_ThrowRangeError, 4,0),
JS_FN("ThrowTypeError", intrinsic_ThrowTypeError, 4,0),
JS_FN("ThrowSyntaxError", intrinsic_ThrowSyntaxError, 4,0),
JS_FN("ThrowAggregateError", intrinsic_ThrowAggregateError, 4,0),
JS_FN("ThrowInternalError", intrinsic_ThrowInternalError, 4,0),
JS_FN("GetErrorMessage", intrinsic_GetErrorMessage, 1,0),
JS_FN("CreateModuleSyntaxError", intrinsic_CreateModuleSyntaxError, 4,0),