| 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-construct-argumentslist-newtarget |
| 5 |
es6id: 9.2.2 |
| 6 |
description: > |
| 7 |
Error when derived constructor does not initialize the `this` binding |
| 8 |
(honoring the Realm of the current execution context) |
| 9 |
info: | |
| 10 |
[...] |
| 11 |
15. Return ? envRec.GetThisBinding(). |
| 12 |
|
| 13 |
8.1.1.3.4 GetThisBinding () |
| 14 |
|
| 15 |
[...] |
| 16 |
3. If envRec.[[ThisBindingStatus]] is "uninitialized", throw a ReferenceError |
| 17 |
exception. |
| 18 |
features: [cross-realm, class] |
| 19 |
---*/ |
| 20 |
|
| 21 |
var C = $262.createRealm().global.eval( |
| 22 |
'(class C extends Object {' + |
| 23 |
' constructor() {}' + |
| 24 |
'});' |
| 25 |
); |
| 26 |
|
| 27 |
assert.throws(ReferenceError, function() { |
| 28 |
new C(); |
| 29 |
}); |