Commit 33d95eeb authored by jameslahm's avatar jameslahm Committed by V8 LUCI CQ

[errors] Correct 'Promise.allSettled.call()' error message

Originally, 'Promise.allSettled.call()' will throw
"Promise.all called on non-object". It should be
"Promise.allSettled called on non-object".

Bug: v8:12122
Change-Id: Ib2c8eba32abec474feece3aaebf0e6c7d09c433a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3459923Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79085}
parent 8568ac65
...@@ -63,6 +63,7 @@ Anna Henningsen <anna@addaleax.net> ...@@ -63,6 +63,7 @@ Anna Henningsen <anna@addaleax.net>
Antoine du Hamel <duhamelantoine1995@gmail.com> Antoine du Hamel <duhamelantoine1995@gmail.com>
Anton Bershanskiy <8knots@protonmail.com> Anton Bershanskiy <8knots@protonmail.com>
Anton Bikineev <ant.bikineev@gmail.com> Anton Bikineev <ant.bikineev@gmail.com>
Ao Wang <wangao.james@bytedance.com>
Archil Sharashenidze <achosharashenidze@gmail.com> Archil Sharashenidze <achosharashenidze@gmail.com>
Bangfu Tao <bangfu.tao@samsung.com> Bangfu Tao <bangfu.tao@samsung.com>
Ben Coe <bencoe@gmail.com> Ben Coe <bencoe@gmail.com>
......
...@@ -319,12 +319,12 @@ Reject(JSAny) { ...@@ -319,12 +319,12 @@ Reject(JSAny) {
transitioning macro GeneratePromiseAll<F1: type, F2: type>( transitioning macro GeneratePromiseAll<F1: type, F2: type>(
implicit context: Context)( implicit context: Context)(
receiver: JSAny, iterable: JSAny, createResolveElementFunctor: F1, receiver: JSAny, iterable: JSAny, createResolveElementFunctor: F1,
createRejectElementFunctor: F2): JSAny { createRejectElementFunctor: F2, message: constexpr string): JSAny {
const nativeContext = LoadNativeContext(context); const nativeContext = LoadNativeContext(context);
// Let C be the this value. // Let C be the this value.
// If Type(C) is not Object, throw a TypeError exception. // If Type(C) is not Object, throw a TypeError exception.
const receiver = Cast<JSReceiver>(receiver) const receiver = Cast<JSReceiver>(receiver)
otherwise ThrowTypeError(MessageTemplate::kCalledOnNonObject, 'Promise.all'); otherwise ThrowTypeError(MessageTemplate::kCalledOnNonObject, message);
// Let promiseCapability be ? NewPromiseCapability(C). // Let promiseCapability be ? NewPromiseCapability(C).
// Don't fire debugEvent so that forwarding the rejection through all does // Don't fire debugEvent so that forwarding the rejection through all does
...@@ -368,7 +368,7 @@ transitioning javascript builtin PromiseAll( ...@@ -368,7 +368,7 @@ transitioning javascript builtin PromiseAll(
js-implicit context: Context, receiver: JSAny)(iterable: JSAny): JSAny { js-implicit context: Context, receiver: JSAny)(iterable: JSAny): JSAny {
return GeneratePromiseAll( return GeneratePromiseAll(
receiver, iterable, PromiseAllResolveElementFunctor{}, receiver, iterable, PromiseAllResolveElementFunctor{},
PromiseAllRejectElementFunctor{}); PromiseAllRejectElementFunctor{}, 'Promise.all');
} }
// ES#sec-promise.allsettled // ES#sec-promise.allsettled
...@@ -377,7 +377,7 @@ transitioning javascript builtin PromiseAllSettled( ...@@ -377,7 +377,7 @@ transitioning javascript builtin PromiseAllSettled(
js-implicit context: Context, receiver: JSAny)(iterable: JSAny): JSAny { js-implicit context: Context, receiver: JSAny)(iterable: JSAny): JSAny {
return GeneratePromiseAll( return GeneratePromiseAll(
receiver, iterable, PromiseAllSettledResolveElementFunctor{}, receiver, iterable, PromiseAllSettledResolveElementFunctor{},
PromiseAllSettledRejectElementFunctor{}); PromiseAllSettledRejectElementFunctor{}, 'Promise.allSettled');
} }
extern macro PromiseAllResolveElementSharedFunConstant(): SharedFunctionInfo; extern macro PromiseAllResolveElementSharedFunConstant(): SharedFunctionInfo;
......
...@@ -525,27 +525,27 @@ KNOWN_OBJECTS = { ...@@ -525,27 +525,27 @@ KNOWN_OBJECTS = {
("old_space", 0x04ac9): "StringSplitCache", ("old_space", 0x04ac9): "StringSplitCache",
("old_space", 0x04ed1): "RegExpMultipleCache", ("old_space", 0x04ed1): "RegExpMultipleCache",
("old_space", 0x052d9): "BuiltinsConstantsTable", ("old_space", 0x052d9): "BuiltinsConstantsTable",
("old_space", 0x05701): "AsyncFunctionAwaitRejectSharedFun", ("old_space", 0x05705): "AsyncFunctionAwaitRejectSharedFun",
("old_space", 0x05725): "AsyncFunctionAwaitResolveSharedFun", ("old_space", 0x05729): "AsyncFunctionAwaitResolveSharedFun",
("old_space", 0x05749): "AsyncGeneratorAwaitRejectSharedFun", ("old_space", 0x0574d): "AsyncGeneratorAwaitRejectSharedFun",
("old_space", 0x0576d): "AsyncGeneratorAwaitResolveSharedFun", ("old_space", 0x05771): "AsyncGeneratorAwaitResolveSharedFun",
("old_space", 0x05791): "AsyncGeneratorYieldResolveSharedFun", ("old_space", 0x05795): "AsyncGeneratorYieldResolveSharedFun",
("old_space", 0x057b5): "AsyncGeneratorReturnResolveSharedFun", ("old_space", 0x057b9): "AsyncGeneratorReturnResolveSharedFun",
("old_space", 0x057d9): "AsyncGeneratorReturnClosedRejectSharedFun", ("old_space", 0x057dd): "AsyncGeneratorReturnClosedRejectSharedFun",
("old_space", 0x057fd): "AsyncGeneratorReturnClosedResolveSharedFun", ("old_space", 0x05801): "AsyncGeneratorReturnClosedResolveSharedFun",
("old_space", 0x05821): "AsyncIteratorValueUnwrapSharedFun", ("old_space", 0x05825): "AsyncIteratorValueUnwrapSharedFun",
("old_space", 0x05845): "PromiseAllResolveElementSharedFun", ("old_space", 0x05849): "PromiseAllResolveElementSharedFun",
("old_space", 0x05869): "PromiseAllSettledResolveElementSharedFun", ("old_space", 0x0586d): "PromiseAllSettledResolveElementSharedFun",
("old_space", 0x0588d): "PromiseAllSettledRejectElementSharedFun", ("old_space", 0x05891): "PromiseAllSettledRejectElementSharedFun",
("old_space", 0x058b1): "PromiseAnyRejectElementSharedFun", ("old_space", 0x058b5): "PromiseAnyRejectElementSharedFun",
("old_space", 0x058d5): "PromiseCapabilityDefaultRejectSharedFun", ("old_space", 0x058d9): "PromiseCapabilityDefaultRejectSharedFun",
("old_space", 0x058f9): "PromiseCapabilityDefaultResolveSharedFun", ("old_space", 0x058fd): "PromiseCapabilityDefaultResolveSharedFun",
("old_space", 0x0591d): "PromiseCatchFinallySharedFun", ("old_space", 0x05921): "PromiseCatchFinallySharedFun",
("old_space", 0x05941): "PromiseGetCapabilitiesExecutorSharedFun", ("old_space", 0x05945): "PromiseGetCapabilitiesExecutorSharedFun",
("old_space", 0x05965): "PromiseThenFinallySharedFun", ("old_space", 0x05969): "PromiseThenFinallySharedFun",
("old_space", 0x05989): "PromiseThrowerFinallySharedFun", ("old_space", 0x0598d): "PromiseThrowerFinallySharedFun",
("old_space", 0x059ad): "PromiseValueThunkFinallySharedFun", ("old_space", 0x059b1): "PromiseValueThunkFinallySharedFun",
("old_space", 0x059d1): "ProxyRevokeSharedFun", ("old_space", 0x059d5): "ProxyRevokeSharedFun",
} }
# Lower 32 bits of first page addresses for various heap spaces. # Lower 32 bits of first page addresses for various heap spaces.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment