Debian Codegraph @

js/src/tests/test262/built-ins/Function/internals/Call/class-ctor-realm.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-ecmascript-function-objects-call-thisargument-argumentslist
5 description: >
6 Error when invoking a default class constructor, honoring the Realm
7 that the class was defined in.
8 features: [cross-realm, class]
9 ---*/
10
11 const realm = $262.createRealm();
12 const C = realm.global.eval('(class {})');
13 const TE = realm.global.TypeError;
14
15 assert.throws(TE, function() {
16 C();
17 });
18
19 reportCompare(0, 0);