address comments

This commit is contained in:
Peter Klecha 2023-07-18 11:15:56 -04:00 committed by Philip Chimento
parent 2a4c458002
commit 1db9a49eb9
2 changed files with 30 additions and 15 deletions

View File

@ -19,14 +19,14 @@ assert.throws(TypeError, function() {
Promise.withResolvers.call(86);
});
assert.throws(TypeError, function() {
Promise.withResolvers.call('string');
});
assert.throws(TypeError, function() {
Promise.withResolvers.call(true);
});
assert.throws(TypeError, function() {
Promise.withResolvers.call(Symbol());
});
assert.throws(TypeError, function() {
Promise.withResolvers.call('string');
});
assert.throws(TypeError, function() {
Promise.withResolvers.call(true);
});
assert.throws(TypeError, function() {
Promise.withResolvers.call(Symbol());
});

View File

@ -4,7 +4,8 @@
/*---
description: Promise.withResolvers result is an object with keys "promise", "reject", and "resolve"
esid: sec-promise.withresolvers
features: [promise-with-resolvers, Object.hasOwn]
includes: [propertyHelper.js]
features: [promise-with-resolvers]
---*/
@ -13,7 +14,21 @@ var instance = Promise.withResolvers();
assert.sameValue(typeof instance, "object");
assert.notSameValue(instance, null);
assert(instance instanceof Object);
assert(Object.hasOwn(instance, "promise"));
assert(Object.hasOwn(instance, "resolve"));
assert(Object.hasOwn(instance, "reject"));
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,
})