tests/auto/qml/ecmascripttests/test262/test/language/expressions/new.target/value-via-fpapply.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-function.prototype.apply |
| 5 | es6id: 19.2.3.1 |
| 6 | description: Value when invoked via `Function.prototype.apply` |
| 7 | info: | |
| 8 | [...] |
| 9 | 5. Return ? Call(func, thisArg, argList). |
| 10 | ---*/ |
| 11 | |
| 12 | var newTarget = null; |
| 13 | |
| 14 | function f() { |
| 15 | newTarget = new.target; |
| 16 | } |
| 17 | |
| 18 | f.apply({}); |
| 19 | |
| 20 | assert.sameValue(newTarget, undefined); |