Add assertions of typeerror on ShadowRealm.prototype.importValue

This commit is contained in:
legendecas 2021-12-08 01:03:26 +08:00 committed by Rick Waldron
parent b9cac998df
commit 6d0a4fdac7

View File

@ -34,7 +34,7 @@ info: |
If hasOwn is false, throw a TypeError exception. If hasOwn is false, throw a TypeError exception.
... ...
flags: [async, module] flags: [async]
features: [ShadowRealm] features: [ShadowRealm]
---*/ ---*/
@ -48,6 +48,11 @@ const r = new ShadowRealm();
r.importValue('./import-value_FIXTURE.js', 'y') r.importValue('./import-value_FIXTURE.js', 'y')
.then( .then(
() => $DONE('Expected rejection'), () => {
() => $DONE() throw new Test262Error("Expected rejection");
); },
err => {
assert.sameValue(Object.getPrototypeOf(err), TypeError.prototype, 'should be rejected with TypeError');
}
)
.then($DONE, $DONE);