6f994a0bdf
CL adopted from joshualitt@: https://chromium-review.googlesource.com/c/v8/v8/+/2002932 Link to explainer is here: https://github.com/tc39/proposal-promise-any Co-authored-by: Joshua Litt <joshualitt@chromium.org> Bug: v8:9808 Change-Id: I6872020e857d4b131d5663f95fd58e6271ccb067 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2124834 Commit-Queue: Marja Hölttä <marja@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Reviewed-by: Shu-yu Guo <syg@chromium.org> Cr-Commit-Position: refs/heads/master@{#67502}
19 lines
578 B
JavaScript
19 lines
578 B
JavaScript
// Copyright 2020 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.
|
|
|
|
// Flags: --allow-natives-syntax --harmony-promise-any
|
|
|
|
load('test/mjsunit/test-async.js');
|
|
|
|
// Test that pre-allocation of the errors array works even if it needs to be
|
|
// allocated in large object space.
|
|
const a = new Array(64 * 1024);
|
|
a.fill(Promise.reject(1));
|
|
testAsync(assert => {
|
|
assert.plan(1);
|
|
Promise.any(a).then(assert.unreachable, b => {
|
|
assert.equals(a.length, b.errors.length);
|
|
});
|
|
});
|