diff options
Diffstat (limited to 'js/src/tests/test262/language/expressions/arrow-function/params-duplicate.js')
-rw-r--r-- | js/src/tests/test262/language/expressions/arrow-function/params-duplicate.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/arrow-function/params-duplicate.js b/js/src/tests/test262/language/expressions/arrow-function/params-duplicate.js new file mode 100644 index 0000000000..02ad57408d --- /dev/null +++ b/js/src/tests/test262/language/expressions/arrow-function/params-duplicate.js @@ -0,0 +1,34 @@ +// |reftest| error:SyntaxError +// Copyright 2019 Mike Pennisi. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-arrow-function-definitions +description: Formal parameters may not contain duplicates +info: | + # 14.2 Arrow Function Definitions + + When the production + + ArrowParameters:CoverParenthesizedExpressionAndArrowParameterList + + is recognized the following grammar is used to refine the interpretation + of CoverParenthesizedExpressionAndArrowParameterList: + + ArrowFormalParameters[Yield, Await]: + (UniqueFormalParameters[?Yield, ?Await]) + + # 14.1.2 Static Semantics: Early Errors + + UniqueFormalParameters:FormalParameters + + - It is a Syntax Error if BoundNames of FormalParameters contains any + duplicate elements. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +0, (a, a) => { }; |