Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/src/dstr-binding/default/cls-expr-meth.template

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 path: language/expressions/class/dstr-meth-
5 name: class expression method
6 esid: sec-class-definitions-runtime-semantics-evaluation
7 es6id: 14.5.16
8 features: [destructuring-binding]
9 info: |
10 ClassExpression : class BindingIdentifieropt ClassTail
11
12 1. If BindingIdentifieropt is not present, let className be undefined.
13 2. Else, let className be StringValue of BindingIdentifier.
14 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
15 with argument className.
16 [...]
17
18 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
19
20 21. For each ClassElement m in order from methods
21 a. If IsStatic of m is false, then
22 i. Let status be the result of performing
23 PropertyDefinitionEvaluation for m with arguments proto and
24 false.
25 [...]
26
27 14.3.8 Runtime Semantics: DefineMethod
28
29 MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
30
31 [...]
32 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
33 scope, strict). If functionPrototype was passed as a parameter then pass its
34 value as the functionPrototype optional argument of FunctionCreate.
35 [...]
36
37 9.2.1 [[Call]] ( thisArgument, argumentsList)
38
39 [...]
40 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
41 [...]
42
43 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
44
45 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
46 [...]
47
48 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
49
50 [...]
51 23. Let iteratorRecord be Record {[[iterator]]:
52 CreateListIterator(argumentsList), [[done]]: false}.
53 24. If hasDuplicates is true, then
54 [...]
55 25. Else,
56 b. Let formalStatus be IteratorBindingInitialization for formals with
57 iteratorRecord and env as arguments.
58 [...]
59 ---*/
60
61 var callCount = 0;
62 var C = class {
63 method(/*{ elems }*/) {
64 /*{ body }*/
65 callCount = callCount + 1;
66 }
67 };
68
69 new C().method(/*{ vals }*/);
70 assert.sameValue(callCount, 1, 'method invoked exactly once');