Debian Codegraph @

js/src/tests/test262/built-ins/Function/internals/Call/class-ctor.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: Error when invoking a class constructor
6 info: |
7 [...]
8 2. If F's [[FunctionKind]] internal slot is "classConstructor", throw a
9 TypeError exception.
10 features: [class]
11 ---*/
12
13 class C {}
14
15 assert.throws(TypeError, function() {
16 C();
17 });
18
19 reportCompare(0, 0);