diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/ShadowRealm/prototype/importValue/validates-realm-object.js')
-rw-r--r-- | js/src/tests/test262/built-ins/ShadowRealm/prototype/importValue/validates-realm-object.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/ShadowRealm/prototype/importValue/validates-realm-object.js b/js/src/tests/test262/built-ins/ShadowRealm/prototype/importValue/validates-realm-object.js new file mode 100644 index 0000000000..dffc3a1682 --- /dev/null +++ b/js/src/tests/test262/built-ins/ShadowRealm/prototype/importValue/validates-realm-object.js @@ -0,0 +1,24 @@ +// |reftest| shell-option(--enable-shadow-realms) skip-if(!xulRuntime.shell) -- requires shell-options +// Copyright (C) 2021 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-shadowrealm.prototype.importvalue +description: > + ShadowRealm.prototype.importValue validates realm object. +features: [ShadowRealm] +---*/ + +assert.sameValue( + typeof ShadowRealm.prototype.importValue, + 'function', + 'This test must fail if ShadowRealm.prototype.importValue is not a function' +); + +const r = new ShadowRealm(); +const bogus = {}; + +assert.throws(TypeError, function() { + r.importValue.call(bogus, "specifier", "name"); +}, 'throws a TypeError if this is not a ShadowRealm object'); + +reportCompare(0, 0); |