| 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 |
info: | |
| 9 |
[...] |
| 10 |
15. Return ? envRec.GetThisBinding(). |
| 11 |
|
| 12 |
8.1.1.3.4 GetThisBinding () |
| 13 |
|
| 14 |
[...] |
| 15 |
3. If envRec.[[ThisBindingStatus]] is "uninitialized", throw a ReferenceError |
| 16 |
exception. |
| 17 |
features: [class] |
| 18 |
---*/ |
| 19 |
|
| 20 |
class C extends Object { |
| 21 |
constructor() {} |
| 22 |
} |
| 23 |
|
| 24 |
assert.throws(ReferenceError, function() { |
| 25 |
new C(); |
| 26 |
}); |