diff options
Diffstat (limited to 'js/src/tests/test262/language/expressions/assignment/target-assignment-inside-function.js')
-rw-r--r-- | js/src/tests/test262/language/expressions/assignment/target-assignment-inside-function.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/assignment/target-assignment-inside-function.js b/js/src/tests/test262/language/expressions/assignment/target-assignment-inside-function.js new file mode 100644 index 0000000000..4ba6dee38c --- /dev/null +++ b/js/src/tests/test262/language/expressions/assignment/target-assignment-inside-function.js @@ -0,0 +1,24 @@ +// |reftest| error:SyntaxError +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-assignment-operators-static-semantics-early-errors +description: Applied to assignment +info: | + AssignmentExpression : LeftHandSideExpression = AssignmentExpression + + - It is an early Syntax Error if LeftHandSideExpression is neither an + ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of + LeftHandSideExpression is invalid or strict. + +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +function f() { + var a, b = 2; + (a = b) = 1; +} |