v8/test/mjsunit/promise-perform-all-settled-resolve-lookup.js
Shu-yu Guo e1fd3f6916 [flags] Remove --harmony-promise-all-settled
It's shipped since M76.

Bug: v8:9060
Change-Id: Ifb107f3ef77ab803d5c0ce34f0a31ac33088c41a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2510610
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70956}
2020-11-03 19:34:42 +00:00

29 lines
624 B
JavaScript

// Copyright 2019 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
let count = 0;
class MyPromise extends Promise {
static get resolve() {
count++;
return super.resolve;
}
}
MyPromise.allSettled([1, 2, 3, 4, 5]);
assertEquals(1, count);
%PerformMicrotaskCheckpoint();
assertEquals(1, count);
count = 0;
MyPromise.allSettled([
Promise.resolve(1),
Promise.resolve(2),
Promise.reject(3)
]);
assertEquals(1, count);
%PerformMicrotaskCheckpoint();
assertEquals(1, count);