mirror of
https://github.com/tc39/test262.git
synced 2025-07-30 01:14:56 +02:00
tests: Realm.prototype.evaluate validate realm object
This commit is contained in:
parent
4c98d138b9
commit
8b7c610232
22
test/built-ins/Realm/prototype/evaluate/validates-realm-object.js
vendored
Normal file
22
test/built-ins/Realm/prototype/evaluate/validates-realm-object.js
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (C) 2021 Rick Waldron. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-realm.prototype.evaluate
|
||||||
|
description: >
|
||||||
|
Realm.prototype.evaluate validates realm object.
|
||||||
|
includes: [isConstructor.js]
|
||||||
|
features: [callable-boundary-realms]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(
|
||||||
|
typeof Realm.prototype.evaluate,
|
||||||
|
'function',
|
||||||
|
'This test must fail if Realm.prototype.evaluate is not a function'
|
||||||
|
);
|
||||||
|
|
||||||
|
const r = new Realm();
|
||||||
|
const bogus = {};
|
||||||
|
|
||||||
|
assert.throws(TypeError, function() {
|
||||||
|
r.evaluate.call(bogus);
|
||||||
|
}, 'throws a TypeError if this is not a Realm object');
|
Loading…
x
Reference in New Issue
Block a user