| 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-super-keyword-runtime-semantics-evaluation |
| 5 |
es6id: 12.3.5.1 |
| 6 |
description: Value when invoked via SuperCall |
| 7 |
info: | |
| 8 |
SuperCall : super Arguments |
| 9 |
|
| 10 |
1. Let newTarget be GetNewTarget(). |
| 11 |
[...] |
| 12 |
6. Let result be ? Construct(func, argList, newTarget). |
| 13 |
[...] |
| 14 |
features: [class] |
| 15 |
---*/ |
| 16 |
|
| 17 |
var newTarget = null; |
| 18 |
|
| 19 |
class Parent { |
| 20 |
get attr() { |
| 21 |
newTarget = new.target; |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
class Child extends Parent { |
| 26 |
constructor() { |
| 27 |
super(); |
| 28 |
super.attr; |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
new Child(); |
| 33 |
|
| 34 |
assert.sameValue(newTarget, undefined); |