summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Promise/withResolvers/result.js
blob: 0679dfaf31dec961f76ee77763ba3fb9aa943568 (plain)
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
35
36
// Copyright (C) 2023 Peter Klecha. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: Promise.withResolvers result is an object with keys "promise", "reject", and "resolve"
esid: sec-promise.withresolvers
includes: [propertyHelper.js]
features: [promise-with-resolvers]
---*/


var instance = Promise.withResolvers();

assert.sameValue(typeof instance, "object");
assert.notSameValue(instance, null);
assert(instance instanceof Object);

verifyProperty(instance, "promise", {
    writable: true,
    configurable: true,
    enumerable: true,
})

verifyProperty(instance, "resolve", {
    writable: true,
    configurable: true,
    enumerable: true,
})

verifyProperty(instance, "reject", {
    writable: true,
    configurable: true,
    enumerable: true,
})

reportCompare(0, 0);