target-assignment-inside-function.js (648B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2020 Rick Waldron. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-assignment-operators-static-semantics-early-errors 6 description: Applied to assignment 7 info: | 8 AssignmentExpression : LeftHandSideExpression = AssignmentExpression 9 10 - It is an early Syntax Error if LeftHandSideExpression is neither an 11 ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of 12 LeftHandSideExpression is invalid or strict. 13 14 negative: 15 phase: parse 16 type: SyntaxError 17 ---*/ 18 19 $DONOTEVALUATE(); 20 21 function f() { 22 var a, b = 2; 23 (a = b) = 1; 24 }