Debian Codegraph @

js/src/tests/test262/built-ins/Promise/withResolvers/resolvers.js

raw
1 // Copyright (C) 2023 Peter Klecha. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: Promise.withResolvers return value has properties called "resolve" and "reject" which are unary functions
6 esid: sec-promise.withresolvers
7 features: [promise-with-resolvers]
8 ---*/
9
10
11 var instance = Promise.withResolvers();
12
13 assert.sameValue(typeof instance.resolve, 'function', 'type of resolve property');
14 assert.sameValue(instance.resolve.length, 1, 'length of resolve property');
15 assert.sameValue(typeof instance.reject, 'function', 'type of reject property');
16 assert.sameValue(instance.reject.length, 1, 'length of reject property');
17
18 reportCompare(0, 0);