forked from tc39/test262
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresolves-empty-object.js
More file actions
29 lines (26 loc) · 1.06 KB
/
resolves-empty-object.js
File metadata and controls
29 lines (26 loc) · 1.06 KB
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
// 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: >
Promise.allKeyed resolves an empty object to an empty null-prototype object
info: |
PerformPromiseAllKeyed ( variant, promises, constructor, resultCapability, promiseResolve )
...
1. Let allKeys be ? promises.[[OwnPropertyKeys]]().
...
7. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] - 1.
8. If remainingElementsCount.[[Value]] = 0, then
a. Let result be CreateKeyedPromiseCombinatorResultObject(keys, values).
b. Perform ? Call(resultCapability.[[Resolve]], undefined, « result »).
includes: [asyncHelpers.js, compareArray.js]
flags: [async]
features: [await-dictionary]
---*/
asyncTest(function() {
return Promise.allKeyed({}).then(function(result) {
assert.sameValue(Object.getPrototypeOf(result), null);
assert.sameValue(result.hasOwnProperty, undefined);
assert.compareArray(Reflect.ownKeys(result), []);
});
});