test262/test/built-ins/ShadowRealm/constructor.js

19 lines
575 B
JavaScript
Raw Normal View History

// Copyright (C) 2021 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
2021-09-02 17:07:19 +02:00
esid: sec-shadowrealm-constructor
description: >
2021-09-02 17:07:19 +02:00
ShadowRealm is a constructor and has [[Construct]] internal method.
includes: [isConstructor.js]
features: [ShadowRealm, Reflect.construct]
---*/
assert.sameValue(
2021-09-02 17:07:19 +02:00
typeof ShadowRealm,
'function',
2021-09-02 17:07:19 +02:00
'This test must fail if ShadowRealm is not a function'
);
2021-09-02 17:07:19 +02:00
assert(isConstructor(ShadowRealm));
assert.sameValue(Object.getPrototypeOf(ShadowRealm), Function.prototype);
new ShadowRealm();