forked from tc39/test262
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreject-immed.js
More file actions
34 lines (29 loc) · 1022 Bytes
/
reject-immed.js
File metadata and controls
34 lines (29 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2026 Danial Asaria (Bloomberg LP). All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-performpromiseallkeyed
description: Rejecting from a synchronously rejected input promise
info: |
PerformPromiseAllKeyed ( variant, promises, constructor, resultCapability, promiseResolve )
...
6. For each element key of allKeys, do
...
b. If desc is not undefined and desc.[[Enumerable]] is true, then
...
8. If variant is all, then
a. Let onRejected be resultCapability.[[Reject]].
...
11. Perform ? Invoke(nextPromise, "then", « onFulfilled, onRejected »).
flags: [async]
features: [await-dictionary]
---*/
var error = new Test262Error();
var p = new Promise(function(_, reject) {
reject(error);
});
Promise.allKeyed({ key: p })
.then(function() {
throw new Test262Error('The promise should not be fulfilled.');
}, function(reason) {
assert.sameValue(reason, error);
}).then($DONE, $DONE);