Debian Codegraph @

js/src/tests/test262/language/expressions/function/dflt-params-duplicates.js

raw
1 // |reftest| error:SyntaxError
2 // This file was procedurally generated from the following sources:
3 // - src/function-forms/dflt-params-duplicates.case
4 // - src/function-forms/syntax/func-expr.template
5 /*---
6 description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (function expression)
7 esid: sec-function-definitions-runtime-semantics-evaluation
8 features: [default-parameters]
9 flags: [generated]
10 negative:
11 phase: parse
12 type: SyntaxError
13 info: |
14 FunctionExpression : function ( FormalParameters ) { FunctionBody }
15
16 [...]
17 3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
18 scope, strict).
19 [...]
20
21 9.2.1 [[Call]] ( thisArgument, argumentsList)
22
23 [...]
24 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
25 [...]
26
27 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
28
29 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
30 [...]
31
32 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
33
34 [...]
35 23. Let iteratorRecord be Record {[[iterator]]:
36 CreateListIterator(argumentsList), [[done]]: false}.
37 24. If hasDuplicates is true, then
38 [...]
39 25. Else,
40 b. Let formalStatus be IteratorBindingInitialization for formals with
41 iteratorRecord and env as arguments.
42 [...]
43
44 14.1.2 Static Semantics: Early Errors
45
46 StrictFormalParameters : FormalParameters
47
48 - It is a Syntax Error if BoundNames of FormalParameters contains any
49 duplicate elements.
50
51 FormalParameters : FormalParameterList
52
53 - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
54 false and BoundNames of FormalParameterList contains any duplicate
55 elements.
56
57 ---*/
58 $DONOTEVALUATE();
59
60 0, function(x = 0, x) {
61
62 };