summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/harmony/shadowrealm-importvalue.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/harmony/shadowrealm-importvalue.js')
-rw-r--r--deps/v8/test/mjsunit/harmony/shadowrealm-importvalue.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/deps/v8/test/mjsunit/harmony/shadowrealm-importvalue.js b/deps/v8/test/mjsunit/harmony/shadowrealm-importvalue.js
index 656201e76a..54007c8190 100644
--- a/deps/v8/test/mjsunit/harmony/shadowrealm-importvalue.js
+++ b/deps/v8/test/mjsunit/harmony/shadowrealm-importvalue.js
@@ -52,14 +52,22 @@ globalThis.foobar = 'outer-scope';
const promise = shadowRealm.importValue('./shadowrealm-skip-not-found.mjs', 'foo');
// Promise is created in caller realm.
assertInstanceof(promise, Promise);
- assertThrowsAsync(promise, TypeError, 'Cannot import in the ShadowRealm');
+ assertThrowsAsync(promise, TypeError, /Cannot import in ShadowRealm \(Error: .+shadowrealm-skip-not-found\.mjs\)/);
}
{
const promise = shadowRealm.importValue('./shadowrealm-skip-2-throw.mjs', 'foo');
// Promise is created in caller realm.
assertInstanceof(promise, Promise);
- assertThrowsAsync(promise, TypeError, 'Cannot import in the ShadowRealm');
+ assertThrowsAsync(promise, TypeError, 'Cannot import in ShadowRealm (Error: foobar)');
+}
+
+// no-side-effects inspection on thrown error
+{
+ const promise = shadowRealm.importValue('./shadowrealm-skip-3-throw-object.mjs', 'foo');
+ // Promise is created in caller realm.
+ assertInstanceof(promise, Promise);
+ assertThrowsAsync(promise, TypeError, 'Cannot import in ShadowRealm ([object Object])');
}
// Invalid args