tests: Realm.prototype.evaluate validate realm object

This commit is contained in:
rwaldron 2021-07-16 13:58:30 -04:00 committed by Rick Waldron
parent 4c98d138b9
commit 8b7c610232

View 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');