Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/arrow-function/dstr-ary-ptrn-rest-not-final-obj.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
3 // - src/dstr-binding/default/arrow-function.template
4 /*---
5 description: Rest element (object binding pattern) may not be followed by any element (arrow function expression)
6 esid: sec-arrow-function-definitions-runtime-semantics-evaluation
7 es6id: 14.2.16
8 features: [destructuring-binding]
9 flags: [generated]
10 negative:
11 phase: parse
12 type: SyntaxError
13 info: |
14 ArrowFunction : ArrowParameters => ConciseBody
15
16 [...]
17 4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, scope, strict).
18 [...]
19
20 9.2.1 [[Call]] ( thisArgument, argumentsList)
21
22 [...]
23 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
24 [...]
25
26 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
27
28 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
29 [...]
30
31 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
32
33 [...]
34 23. Let iteratorRecord be Record {[[iterator]]:
35 CreateListIterator(argumentsList), [[done]]: false}.
36 24. If hasDuplicates is true, then
37 [...]
38 25. Else,
39 b. Let formalStatus be IteratorBindingInitialization for formals with
40 iteratorRecord and env as arguments.
41 [...]
42
43 13.3.3 Destructuring Binding Patterns
44 ArrayBindingPattern[Yield] :
45 [ Elisionopt BindingRestElement[?Yield]opt ]
46 [ BindingElementList[?Yield] ]
47 [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
48 ---*/
49 throw "Test262: This statement should not be evaluated.";
50
51 var callCount = 0;
52 var f;
53 f = ([...{ x }, y]) => {
54
55 callCount = callCount + 1;
56 };
57
58 f([1, 2, 3]);
59 assert.sameValue(callCount, 1, 'arrow function invoked exactly once');