From 6d0a4fdac7802980f090663895c16786c9848e66 Mon Sep 17 00:00:00 2001 From: legendecas Date: Wed, 8 Dec 2021 01:03:26 +0800 Subject: [PATCH] Add assertions of typeerror on ShadowRealm.prototype.importValue --- .../throws-if-import-value-does-not-exist.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/built-ins/ShadowRealm/prototype/importValue/throws-if-import-value-does-not-exist.js b/test/built-ins/ShadowRealm/prototype/importValue/throws-if-import-value-does-not-exist.js index 3f4d93b96a..257dfcfc7f 100644 --- a/test/built-ins/ShadowRealm/prototype/importValue/throws-if-import-value-does-not-exist.js +++ b/test/built-ins/ShadowRealm/prototype/importValue/throws-if-import-value-does-not-exist.js @@ -34,7 +34,7 @@ info: | If hasOwn is false, throw a TypeError exception. ... -flags: [async, module] +flags: [async] features: [ShadowRealm] ---*/ @@ -48,6 +48,11 @@ const r = new ShadowRealm(); r.importValue('./import-value_FIXTURE.js', 'y') .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);