Commit 5e060e41 authored by jameslahm's avatar jameslahm Committed by V8 LUCI CQ

[errors-test] Add test for 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". Add test
for it.

Bug: v8:12122
Change-Id: I496a7c9d31baeb5b99012461387cfbccc4100d2b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3463063Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79096}
parent d7b2dd09
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const promiseAllCallOnNonObjectErrorMessage =
'Promise.all called on non-object';
const promiseAllSettledCallOnNonObjectErrorMessage =
'Promise.allSettled called on non-object';
assertThrows(
() => Promise.all.call(), TypeError, promiseAllCallOnNonObjectErrorMessage);
assertThrows(
() => Promise.allSettled.call(), TypeError,
promiseAllSettledCallOnNonObjectErrorMessage);
assertThrows(
() => Promise.all.apply(), TypeError,
promiseAllCallOnNonObjectErrorMessage);
assertThrows(
() => Promise.allSettled.apply(), TypeError,
promiseAllSettledCallOnNonObjectErrorMessage);
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