| 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 |
es6id: 9.2.1 |
| 6 |
description: > |
| 7 |
Error when invoking a class constructor (honoring the Realm of the current |
| 8 |
execution context) |
| 9 |
info: | |
| 10 |
[...] |
| 11 |
2. If F's [[FunctionKind]] internal slot is "classConstructor", throw a |
| 12 |
TypeError exception. |
| 13 |
features: [cross-realm, class] |
| 14 |
---*/ |
| 15 |
|
| 16 |
var C = $262.createRealm().global.eval('0, class {}'); |
| 17 |
|
| 18 |
assert.throws(TypeError, function() { |
| 19 |
C(); |
| 20 |
}); |