target-cover-newtarget.js (696B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2016 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-update-expressions-static-semantics-early-errors 6 description: Applied to a "covered" new.target 7 info: | 8 UnaryExpression : 9 ++ UnaryExpression 10 -- UnaryExpression 11 12 - It is an early Syntax Error if IsValidSimpleAssignmentTarget of 13 UnaryExpression is invalid or strict. 14 15 12.3.1.6 Static Semantics: AssignmentTargetType 16 17 NewTarget: 18 19 new.target 20 21 1. Return invalid. 22 negative: 23 phase: parse 24 type: SyntaxError 25 features: [new.target] 26 ---*/ 27 28 $DONOTEVALUATE(); 29 30 function f() { 31 ++(new.target); 32 }