summaryrefslogtreecommitdiff
path: root/src/function-forms
diff options
context:
space:
mode:
authorLeo Balter <leonardo.balter@gmail.com>2017-04-20 11:04:52 -0400
committerLeo Balter <leonardo.balter@gmail.com>2017-04-21 15:03:46 -0400
commit20d496729d930bb5cb158b93cb79be736f56e54a (patch)
tree17df60addfcf2e0f0cb3b1cfe6b52a1ae3b09555 /src/function-forms
parent94f6003d112f4b4c844f90f2e4f05bd3e1e3e740 (diff)
downloadqtdeclarative-testsuites-20d496729d930bb5cb158b93cb79be736f56e54a.tar.gz
Rename src/params to src/function-forms
The templates are being used for many tests reusing the same available function forms. The format they are provided allow us to extend tests with cases for other tests relying in the same formats.
Diffstat (limited to 'src/function-forms')
-rw-r--r--src/function-forms/default/arrow-function.template47
-rw-r--r--src/function-forms/default/async-gen-func-decl.template29
-rw-r--r--src/function-forms/default/async-gen-func-expr.template30
-rw-r--r--src/function-forms/default/async-gen-meth.template37
-rw-r--r--src/function-forms/default/async-gen-named-func-expr.template30
-rw-r--r--src/function-forms/default/cls-decl-async-gen-meth-static.template56
-rw-r--r--src/function-forms/default/cls-decl-async-gen-meth.template55
-rw-r--r--src/function-forms/default/cls-decl-gen-meth-static.template73
-rw-r--r--src/function-forms/default/cls-decl-gen-meth.template73
-rw-r--r--src/function-forms/default/cls-decl-meth-static.template71
-rw-r--r--src/function-forms/default/cls-decl-meth.template71
-rw-r--r--src/function-forms/default/cls-expr-async-gen-meth-static.template56
-rw-r--r--src/function-forms/default/cls-expr-async-gen-meth.template57
-rw-r--r--src/function-forms/default/cls-expr-gen-meth-static.template75
-rw-r--r--src/function-forms/default/cls-expr-gen-meth.template75
-rw-r--r--src/function-forms/default/cls-expr-meth-static.template72
-rw-r--r--src/function-forms/default/cls-expr-meth.template72
-rw-r--r--src/function-forms/default/func-decl.template49
-rw-r--r--src/function-forms/default/func-expr.template49
-rw-r--r--src/function-forms/default/gen-func-decl.template48
-rw-r--r--src/function-forms/default/gen-func-expr.template49
-rw-r--r--src/function-forms/default/gen-meth.template57
-rw-r--r--src/function-forms/default/meth.template54
-rw-r--r--src/function-forms/dflt-abrupt.case22
-rw-r--r--src/function-forms/dflt-arg-val-not-undefined.case48
-rw-r--r--src/function-forms/dflt-arg-val-undefined.case30
-rw-r--r--src/function-forms/dflt-duplicates.case28
-rw-r--r--src/function-forms/dflt-ref-later.case24
-rw-r--r--src/function-forms/dflt-ref-prior.case28
-rw-r--r--src/function-forms/dflt-ref-self.case24
-rw-r--r--src/function-forms/dflt-rest.case30
-rw-r--r--src/function-forms/error/arrow-function.template48
-rw-r--r--src/function-forms/error/async-gen-func-decl.template29
-rw-r--r--src/function-forms/error/async-gen-func-expr.template29
-rw-r--r--src/function-forms/error/async-gen-meth.template34
-rw-r--r--src/function-forms/error/async-gen-named-func-expr.template29
-rw-r--r--src/function-forms/error/cls-decl-async-gen-meth-static.template54
-rw-r--r--src/function-forms/error/cls-decl-async-gen-meth.template52
-rw-r--r--src/function-forms/error/cls-decl-gen-meth-static.template72
-rw-r--r--src/function-forms/error/cls-decl-gen-meth.template71
-rw-r--r--src/function-forms/error/cls-decl-meth-static.template69
-rw-r--r--src/function-forms/error/cls-decl-meth.template69
-rw-r--r--src/function-forms/error/cls-expr-async-gen-meth-static.template53
-rw-r--r--src/function-forms/error/cls-expr-async-gen-meth.template74
-rw-r--r--src/function-forms/error/cls-expr-gen-meth-static.template73
-rw-r--r--src/function-forms/error/cls-expr-gen-meth.template73
-rw-r--r--src/function-forms/error/cls-expr-meth-static.template70
-rw-r--r--src/function-forms/error/cls-expr-meth.template70
-rw-r--r--src/function-forms/error/func-decl.template48
-rw-r--r--src/function-forms/error/func-expr.template49
-rw-r--r--src/function-forms/error/gen-func-decl.template49
-rw-r--r--src/function-forms/error/gen-func-expr.template49
-rw-r--r--src/function-forms/error/gen-meth.template55
-rw-r--r--src/function-forms/error/meth.template52
-rw-r--r--src/function-forms/syntax/arrow-function.template40
-rw-r--r--src/function-forms/syntax/async-gen-func-decl.template21
-rw-r--r--src/function-forms/syntax/async-gen-func-expr.template21
-rw-r--r--src/function-forms/syntax/async-gen-meth.template27
-rw-r--r--src/function-forms/syntax/async-gen-named-func-expr.template21
-rw-r--r--src/function-forms/syntax/cls-decl-async-gen-meth-static.template46
-rw-r--r--src/function-forms/syntax/cls-decl-async-gen-meth.template45
-rw-r--r--src/function-forms/syntax/cls-decl-gen-meth-static.template64
-rw-r--r--src/function-forms/syntax/cls-decl-gen-meth.template64
-rw-r--r--src/function-forms/syntax/cls-decl-meth-static.template62
-rw-r--r--src/function-forms/syntax/cls-decl-meth.template62
-rw-r--r--src/function-forms/syntax/cls-expr-async-gen-meth-static.template46
-rw-r--r--src/function-forms/syntax/cls-expr-async-gen-meth.template46
-rw-r--r--src/function-forms/syntax/cls-expr-gen-meth-static.template66
-rw-r--r--src/function-forms/syntax/cls-expr-gen-meth.template66
-rw-r--r--src/function-forms/syntax/cls-expr-meth-static.template63
-rw-r--r--src/function-forms/syntax/cls-expr-meth.template63
-rw-r--r--src/function-forms/syntax/func-decl.template42
-rw-r--r--src/function-forms/syntax/func-expr.template41
-rw-r--r--src/function-forms/syntax/gen-func-decl.template41
-rw-r--r--src/function-forms/syntax/gen-func-expr.template41
-rw-r--r--src/function-forms/syntax/gen-meth.template48
-rw-r--r--src/function-forms/syntax/meth.template45
-rw-r--r--src/function-forms/trailing-comma-dflt-param.case23
-rw-r--r--src/function-forms/trailing-comma-multiple-param.case23
-rw-r--r--src/function-forms/trailing-comma-rest-early-error.case24
-rw-r--r--src/function-forms/trailing-comma-single-param.case22
81 files changed, 3963 insertions, 0 deletions
diff --git a/src/function-forms/default/arrow-function.template b/src/function-forms/default/arrow-function.template
new file mode 100644
index 000000000..fd20b0240
--- /dev/null
+++ b/src/function-forms/default/arrow-function.template
@@ -0,0 +1,47 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/arrow-function/params-
+name: arrow function expression
+esid: sec-arrow-function-definitions-runtime-semantics-evaluation
+info: |
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ [...]
+ 4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+// Stores a reference `ref` for case evaluation
+var ref;
+ref = (/*{ params }*/) => {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+ref(/*{ args }*/);
+assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
diff --git a/src/function-forms/default/async-gen-func-decl.template b/src/function-forms/default/async-gen-func-decl.template
new file mode 100644
index 000000000..ad18e33c2
--- /dev/null
+++ b/src/function-forms/default/async-gen-func-decl.template
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/statements/async-generator/params-
+name: async generator function declaration
+esid: sec-asyncgenerator-definitions-instantiatefunctionobject
+info: |
+ AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
+ ( FormalParameters ) { AsyncGeneratorBody }
+
+ [...]
+ 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
+ scope, strict).
+ [...]
+flags: [async]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+// Stores a reference `ref` for case evaluation
+async function* ref(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+}
+
+ref(/*{ args }*/).next().then(() => {
+ assert.sameValue(callCount, 1, 'generator function invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/src/function-forms/default/async-gen-func-expr.template b/src/function-forms/default/async-gen-func-expr.template
new file mode 100644
index 000000000..bf4725772
--- /dev/null
+++ b/src/function-forms/default/async-gen-func-expr.template
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/expressions/async-generator/params-
+name: async generator function expression
+esid: sec-asyncgenerator-definitions-evaluation
+info: |
+ AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
+ AsyncGeneratorBody }
+
+ [...]
+ 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+flags: [async]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+// Stores a reference `ref` for case evaluation
+var ref;
+ref = async function*(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+ref(/*{ args }*/).next().then(() => {
+ assert.sameValue(callCount, 1, 'generator function invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/src/function-forms/default/async-gen-meth.template b/src/function-forms/default/async-gen-meth.template
new file mode 100644
index 000000000..88531de65
--- /dev/null
+++ b/src/function-forms/default/async-gen-meth.template
@@ -0,0 +1,37 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/object/method-definition/params-async-gen-meth-
+name: async generator method
+esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
+info: |
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+flags: [async]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+var obj = {
+ async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+// Stores a reference `ref` for case evaluation
+var ref = obj.method;
+
+ref(/*{ args }*/).next().then(() => {
+ assert.sameValue(callCount, 1, 'generator method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/src/function-forms/default/async-gen-named-func-expr.template b/src/function-forms/default/async-gen-named-func-expr.template
new file mode 100644
index 000000000..4d8aa531e
--- /dev/null
+++ b/src/function-forms/default/async-gen-named-func-expr.template
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/expressions/async-generator/params-named-
+name: async generator named function expression
+esid: sec-asyncgenerator-definitions-evaluation
+info: |
+ AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
+ ( FormalParameters ) { AsyncGeneratorBody }
+
+ [...]
+ 7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
+ AsyncGeneratorBody, funcEnv, strict).
+ [...]
+flags: [async]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+// Stores a reference `ref` for case evaluation
+var ref;
+ref = async function* g(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+ref(/*{ args }*/).next().then(() => {
+ assert.sameValue(callCount, 1, 'generator function invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/src/function-forms/default/cls-decl-async-gen-meth-static.template b/src/function-forms/default/cls-decl-async-gen-meth-static.template
new file mode 100644
index 000000000..896c1a4d0
--- /dev/null
+++ b/src/function-forms/default/cls-decl-async-gen-meth-static.template
@@ -0,0 +1,56 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/statements/class/params-async-gen-meth-static-
+name: static class expression generator method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+flags: [async]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+class C {
+ static async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(/*{ args }*/).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/src/function-forms/default/cls-decl-async-gen-meth.template b/src/function-forms/default/cls-decl-async-gen-meth.template
new file mode 100644
index 000000000..045c67944
--- /dev/null
+++ b/src/function-forms/default/cls-decl-async-gen-meth.template
@@ -0,0 +1,55 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-async-gen-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+flags: [async]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+class C {
+ async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(/*{ args }*/).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/src/function-forms/default/cls-decl-gen-meth-static.template b/src/function-forms/default/cls-decl-gen-meth-static.template
new file mode 100644
index 000000000..27c85fe30
--- /dev/null
+++ b/src/function-forms/default/cls-decl-gen-meth-static.template
@@ -0,0 +1,73 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-gen-meth-static-
+name: static class expression generator method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+class C {
+ static *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+C.method(/*{ args }*/).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/src/function-forms/default/cls-decl-gen-meth.template b/src/function-forms/default/cls-decl-gen-meth.template
new file mode 100644
index 000000000..f44f7eb89
--- /dev/null
+++ b/src/function-forms/default/cls-decl-gen-meth.template
@@ -0,0 +1,73 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-gen-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+class C {
+ *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+C.prototype.method(/*{ args }*/).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/src/function-forms/default/cls-decl-meth-static.template b/src/function-forms/default/cls-decl-meth-static.template
new file mode 100644
index 000000000..c6287aa20
--- /dev/null
+++ b/src/function-forms/default/cls-decl-meth-static.template
@@ -0,0 +1,71 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-meth-static-
+name: static class expression method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+class C {
+ static method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+C.method(/*{ args }*/);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/src/function-forms/default/cls-decl-meth.template b/src/function-forms/default/cls-decl-meth.template
new file mode 100644
index 000000000..695624b95
--- /dev/null
+++ b/src/function-forms/default/cls-decl-meth.template
@@ -0,0 +1,71 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-meth-
+name: class expression method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+class C {
+ method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+C.prototype.method(/*{ args }*/);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/src/function-forms/default/cls-expr-async-gen-meth-static.template b/src/function-forms/default/cls-expr-async-gen-meth-static.template
new file mode 100644
index 000000000..345191dd4
--- /dev/null
+++ b/src/function-forms/default/cls-expr-async-gen-meth-static.template
@@ -0,0 +1,56 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-async-gen-meth-static-
+name: static class expression async generator method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+flags: [async]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(/*{ args }*/).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/src/function-forms/default/cls-expr-async-gen-meth.template b/src/function-forms/default/cls-expr-async-gen-meth.template
new file mode 100644
index 000000000..ca94df65a
--- /dev/null
+++ b/src/function-forms/default/cls-expr-async-gen-meth.template
@@ -0,0 +1,57 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-async-gen-meth-
+name: class expression async generator method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+flags: [async]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+var C = class {
+ async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+ref(/*{ args }*/).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
diff --git a/src/function-forms/default/cls-expr-gen-meth-static.template b/src/function-forms/default/cls-expr-gen-meth-static.template
new file mode 100644
index 000000000..05ed9a797
--- /dev/null
+++ b/src/function-forms/default/cls-expr-gen-meth-static.template
@@ -0,0 +1,75 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-gen-meth-static-
+name: static class expression generator method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+C.method(/*{ args }*/).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/src/function-forms/default/cls-expr-gen-meth.template b/src/function-forms/default/cls-expr-gen-meth.template
new file mode 100644
index 000000000..0e7cf0d16
--- /dev/null
+++ b/src/function-forms/default/cls-expr-gen-meth.template
@@ -0,0 +1,75 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-gen-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(/*{ args }*/).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/src/function-forms/default/cls-expr-meth-static.template b/src/function-forms/default/cls-expr-meth-static.template
new file mode 100644
index 000000000..789a94b13
--- /dev/null
+++ b/src/function-forms/default/cls-expr-meth-static.template
@@ -0,0 +1,72 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-meth-static-
+name: static class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+C.method(/*{ args }*/);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/src/function-forms/default/cls-expr-meth.template b/src/function-forms/default/cls-expr-meth.template
new file mode 100644
index 000000000..9dba08c1e
--- /dev/null
+++ b/src/function-forms/default/cls-expr-meth.template
@@ -0,0 +1,72 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+C.prototype.method(/*{ args }*/);
+
+// Stores a reference `ref` for case evaluation
+var ref = C.prototype.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/src/function-forms/default/func-decl.template b/src/function-forms/default/func-decl.template
new file mode 100644
index 000000000..8ef8a19e8
--- /dev/null
+++ b/src/function-forms/default/func-decl.template
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/function/params-
+name: function declaration
+esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
+info: |
+ FunctionDeclaration :
+ function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ [...]
+ 3. Let F be FunctionCreate(Normal, FormalParameters, FunctionBody,
+ scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+// Stores a reference `ref` for case evaluation
+function ref(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+}
+
+ref(/*{ args }*/);
+
+assert.sameValue(callCount, 1, 'function invoked exactly once');
diff --git a/src/function-forms/default/func-expr.template b/src/function-forms/default/func-expr.template
new file mode 100644
index 000000000..43df028a9
--- /dev/null
+++ b/src/function-forms/default/func-expr.template
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/function/params-
+name: function expression
+esid: sec-function-definitions-runtime-semantics-evaluation
+info: |
+ FunctionExpression : function ( FormalParameters ) { FunctionBody }
+
+ [...]
+ 3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
+ scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+// Stores a reference `ref` for case evaluation
+var ref;
+ref = function(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+ref(/*{ args }*/);
+
+assert.sameValue(callCount, 1, 'function invoked exactly once');
diff --git a/src/function-forms/default/gen-func-decl.template b/src/function-forms/default/gen-func-decl.template
new file mode 100644
index 000000000..e35835e7b
--- /dev/null
+++ b/src/function-forms/default/gen-func-decl.template
@@ -0,0 +1,48 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/generators/params-
+name: generator function declaration
+esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
+info: |
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+
+ [...]
+ 2. Let F be GeneratorFunctionCreate(Normal, FormalParameters,
+ GeneratorBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+// Stores a reference `ref` for case evaluation
+function* ref(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+}
+
+ref(/*{ args }*/).next();
+
+assert.sameValue(callCount, 1, 'generator function invoked exactly once');
diff --git a/src/function-forms/default/gen-func-expr.template b/src/function-forms/default/gen-func-expr.template
new file mode 100644
index 000000000..5ba0714cf
--- /dev/null
+++ b/src/function-forms/default/gen-func-expr.template
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/generators/params-
+name: generator function expression
+esid: sec-generator-function-definitions-runtime-semantics-evaluation
+info: |
+ GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
+
+ [...]
+ 3. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
+ GeneratorBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+// Stores a reference `ref` for case evaluation
+var ref;
+ref = function*(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+ref(/*{ args }*/).next();
+
+assert.sameValue(callCount, 1, 'generator function invoked exactly once');
diff --git a/src/function-forms/default/gen-meth.template b/src/function-forms/default/gen-meth.template
new file mode 100644
index 000000000..17caf8cf9
--- /dev/null
+++ b/src/function-forms/default/gen-meth.template
@@ -0,0 +1,57 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/object/method-definition/params-gen-meth-
+name: generator method
+esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
+info: |
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var obj = {
+ *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+obj.method(/*{ args }*/).next();
+
+// Stores a reference `ref` for case evaluation
+var ref = obj.method;
+
+assert.sameValue(callCount, 1, 'generator method invoked exactly once');
diff --git a/src/function-forms/default/meth.template b/src/function-forms/default/meth.template
new file mode 100644
index 000000000..bafbfe807
--- /dev/null
+++ b/src/function-forms/default/meth.template
@@ -0,0 +1,54 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/object/method-definition/params-meth-
+name: method
+esid: sec-runtime-semantics-definemethod
+info: |
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters,
+ FunctionBody, scope, strict). If functionPrototype was passed as a
+ parameter then pass its value as the functionPrototype optional argument
+ of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var obj = {
+ method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+obj.method(/*{ args }*/);
+
+// Stores a reference `ref` for case evaluation
+var ref = obj.method;
+
+assert.sameValue(callCount, 1, 'method invoked exactly once');
diff --git a/src/function-forms/dflt-abrupt.case b/src/function-forms/dflt-abrupt.case
new file mode 100644
index 000000000..f89c45c70
--- /dev/null
+++ b/src/function-forms/dflt-abrupt.case
@@ -0,0 +1,22 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: Abrupt completion returned by evaluation of initializer
+template: error
+info: |
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+features: [default-parameters]
+---*/
+
+//- params
+_ = (function() { throw new Test262Error(); }())
+//- error
+Test262Error
diff --git a/src/function-forms/dflt-arg-val-not-undefined.case b/src/function-forms/dflt-arg-val-not-undefined.case
new file mode 100644
index 000000000..520ce7d91
--- /dev/null
+++ b/src/function-forms/dflt-arg-val-not-undefined.case
@@ -0,0 +1,48 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: Use of intializer when argument value is not `undefined`
+template: default
+info: |
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+features: [default-parameters]
+---*/
+
+//- setup
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+//- params
+aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1
+//- args
+false, '', NaN, 0, null, obj
+//- body
+assert.sameValue(aFalse, false);
+assert.sameValue(aString, '');
+assert.sameValue(aNaN, NaN);
+assert.sameValue(a0, 0);
+assert.sameValue(aNull, null);
+assert.sameValue(aObj, obj);
+//- teardown
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
diff --git a/src/function-forms/dflt-arg-val-undefined.case b/src/function-forms/dflt-arg-val-undefined.case
new file mode 100644
index 000000000..f1396d31f
--- /dev/null
+++ b/src/function-forms/dflt-arg-val-undefined.case
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: Use of intializer when argument value is `undefined`
+template: default
+info: |
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+features: [default-parameters]
+---*/
+
+//- params
+fromLiteral = 23, fromExpr = 45, fromHole = 99
+//- args
+undefined, void 0
+//- body
+assert.sameValue(fromLiteral, 23);
+assert.sameValue(fromExpr, 45);
+assert.sameValue(fromHole, 99);
diff --git a/src/function-forms/dflt-duplicates.case b/src/function-forms/dflt-duplicates.case
new file mode 100644
index 000000000..544c444a8
--- /dev/null
+++ b/src/function-forms/dflt-duplicates.case
@@ -0,0 +1,28 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: >
+ It is a Syntax Error if BoundNames of FormalParameters contains any duplicate
+ elements.
+template: syntax
+negative:
+ phase: early
+ type: SyntaxError
+info: |
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+features: [default-parameters]
+---*/
+
+//- params
+x = 0, x
diff --git a/src/function-forms/dflt-ref-later.case b/src/function-forms/dflt-ref-later.case
new file mode 100644
index 000000000..c5931045d
--- /dev/null
+++ b/src/function-forms/dflt-ref-later.case
@@ -0,0 +1,24 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: Referencing a parameter that occurs later in the ParameterList
+template: error
+info: |
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+features: [default-parameters]
+---*/
+
+//- setup
+var x = 0;
+//- params
+x = y, y
+//- error
+ReferenceError
diff --git a/src/function-forms/dflt-ref-prior.case b/src/function-forms/dflt-ref-prior.case
new file mode 100644
index 000000000..95777ab77
--- /dev/null
+++ b/src/function-forms/dflt-ref-prior.case
@@ -0,0 +1,28 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: Referencing a parameter that occurs earlier in the ParameterList
+template: default
+info: |
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+features: [default-parameters]
+---*/
+
+//- setup
+var x = 0;
+//- params
+x, y = x, z = y
+//- args
+3
+//- body
+assert.sameValue(x, 3, 'first argument value');
+assert.sameValue(y, 3, 'second argument value');
+assert.sameValue(z, 3, 'third argument value');
diff --git a/src/function-forms/dflt-ref-self.case b/src/function-forms/dflt-ref-self.case
new file mode 100644
index 000000000..d553e0543
--- /dev/null
+++ b/src/function-forms/dflt-ref-self.case
@@ -0,0 +1,24 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: Referencing a parameter from within its own initializer
+template: error
+info: |
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+features: [default-parameters]
+---*/
+
+//- setup
+var x = 0;
+//- params
+x = x
+//- error
+ReferenceError
diff --git a/src/function-forms/dflt-rest.case b/src/function-forms/dflt-rest.case
new file mode 100644
index 000000000..2b96d624a
--- /dev/null
+++ b/src/function-forms/dflt-rest.case
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: RestParameter does not support an initializer
+template: syntax
+info: |
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+features: [default-parameters]
+negative:
+ phase: early
+ type: SyntaxError
+---*/
+
+//- params
+...x = []
diff --git a/src/function-forms/error/arrow-function.template b/src/function-forms/error/arrow-function.template
new file mode 100644
index 000000000..a91cc3836
--- /dev/null
+++ b/src/function-forms/error/arrow-function.template
@@ -0,0 +1,48 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/arrow-function/params-
+name: arrow function expression
+esid: sec-arrow-function-definitions-runtime-semantics-evaluation
+info: |
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ [...]
+ 4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var f;
+f = (/*{ params }*/) => {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+assert.throws(/*{ error }*/, function() {
+ f(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'arrow function body not evaluated');
diff --git a/src/function-forms/error/async-gen-func-decl.template b/src/function-forms/error/async-gen-func-decl.template
new file mode 100644
index 000000000..913d2b61d
--- /dev/null
+++ b/src/function-forms/error/async-gen-func-decl.template
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/statements/async-generator/params-
+name: async generator function declaration
+esid: sec-asyncgenerator-definitions-instantiatefunctionobject
+info: |
+ AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
+ ( FormalParameters ) { AsyncGeneratorBody }
+
+ [...]
+ 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
+ scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+async function* f(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+}
+
+assert.throws(/*{ error }*/, function() {
+ f(/*{ args }*/);
+});
+
+assert.sameValue(callCount, 0, 'generator function body not evaluated');
diff --git a/src/function-forms/error/async-gen-func-expr.template b/src/function-forms/error/async-gen-func-expr.template
new file mode 100644
index 000000000..2f2c9e44a
--- /dev/null
+++ b/src/function-forms/error/async-gen-func-expr.template
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/expressions/async-generator/params-
+name: async generator function expression
+esid: sec-asyncgenerator-definitions-evaluation
+info: |
+ AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
+ AsyncGeneratorBody }
+
+ [...]
+ 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+var f;
+f = async function*(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+assert.throws(/*{ error }*/, function() {
+ f(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'generator function body not evaluated');
diff --git a/src/function-forms/error/async-gen-meth.template b/src/function-forms/error/async-gen-meth.template
new file mode 100644
index 000000000..8fc908ea6
--- /dev/null
+++ b/src/function-forms/error/async-gen-meth.template
@@ -0,0 +1,34 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/object/method-definition/params-async-gen-meth-
+name: async generator method
+esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
+info: |
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+var obj = {
+ async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(/*{ error }*/, function() {
+ obj.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'generator method body not evaluated');
diff --git a/src/function-forms/error/async-gen-named-func-expr.template b/src/function-forms/error/async-gen-named-func-expr.template
new file mode 100644
index 000000000..852b2c1a7
--- /dev/null
+++ b/src/function-forms/error/async-gen-named-func-expr.template
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/expressions/async-generator/params-named-
+name: async generator named function expression
+esid: sec-asyncgenerator-definitions-evaluation
+info: |
+ AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
+ ( FormalParameters ) { AsyncGeneratorBody }
+
+ [...]
+ 7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
+ AsyncGeneratorBody, funcEnv, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+var f;
+f = async function* g(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+assert.throws(/*{ error }*/, function() {
+ f(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'generator function body not evaluated');
diff --git a/src/function-forms/error/cls-decl-async-gen-meth-static.template b/src/function-forms/error/cls-decl-async-gen-meth-static.template
new file mode 100644
index 000000000..5c89cf028
--- /dev/null
+++ b/src/function-forms/error/cls-decl-async-gen-meth-static.template
@@ -0,0 +1,54 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/statements/class/params-async-gen-meth-static-
+name: static class expression generator method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+class C {
+ static async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+assert.throws(/*{ error }*/, function() {
+ C.method(/*{ args }*/);
+});
+
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-decl-async-gen-meth.template b/src/function-forms/error/cls-decl-async-gen-meth.template
new file mode 100644
index 000000000..a8295f8df
--- /dev/null
+++ b/src/function-forms/error/cls-decl-async-gen-meth.template
@@ -0,0 +1,52 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-async-gen-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+class C {
+ async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+assert.throws(/*{ error }*/, function() {
+ C.prototype.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-decl-gen-meth-static.template b/src/function-forms/error/cls-decl-gen-meth-static.template
new file mode 100644
index 000000000..25d450673
--- /dev/null
+++ b/src/function-forms/error/cls-decl-gen-meth-static.template
@@ -0,0 +1,72 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-gen-meth-static-
+name: static class expression generator method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+class C {
+ static *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+assert.throws(/*{ error }*/, function() {
+ C.method(/*{ args }*/);
+});
+
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-decl-gen-meth.template b/src/function-forms/error/cls-decl-gen-meth.template
new file mode 100644
index 000000000..13a8e2789
--- /dev/null
+++ b/src/function-forms/error/cls-decl-gen-meth.template
@@ -0,0 +1,71 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-gen-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+class C {
+ *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+assert.throws(/*{ error }*/, function() {
+ C.prototype.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-decl-meth-static.template b/src/function-forms/error/cls-decl-meth-static.template
new file mode 100644
index 000000000..0252314e0
--- /dev/null
+++ b/src/function-forms/error/cls-decl-meth-static.template
@@ -0,0 +1,69 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-meth-static-
+name: static class expression method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+class C {
+ static method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+assert.throws(/*{ error }*/, function() {
+ C.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-decl-meth.template b/src/function-forms/error/cls-decl-meth.template
new file mode 100644
index 000000000..9f6889603
--- /dev/null
+++ b/src/function-forms/error/cls-decl-meth.template
@@ -0,0 +1,69 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-meth-
+name: class expression method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+class C {
+ method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+}
+
+assert.throws(/*{ error }*/, function() {
+ C.prototype.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-expr-async-gen-meth-static.template b/src/function-forms/error/cls-expr-async-gen-meth-static.template
new file mode 100644
index 000000000..c01742a08
--- /dev/null
+++ b/src/function-forms/error/cls-expr-async-gen-meth-static.template
@@ -0,0 +1,53 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-async-gen-meth-static-
+name: static class expression async generator method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(/*{ error }*/, function() {
+ C.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-expr-async-gen-meth.template b/src/function-forms/error/cls-expr-async-gen-meth.template
new file mode 100644
index 000000000..2f8735d28
--- /dev/null
+++ b/src/function-forms/error/cls-expr-async-gen-meth.template
@@ -0,0 +1,74 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-async-gen-meth-
+name: class expression async generator method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+features: [async-iteration]
+---*/
+
+var callCount = 0;
+var C = class {
+ async *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(/*{ error }*/, function() {
+ C.prototype.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-expr-gen-meth-static.template b/src/function-forms/error/cls-expr-gen-meth-static.template
new file mode 100644
index 000000000..14c8afc66
--- /dev/null
+++ b/src/function-forms/error/cls-expr-gen-meth-static.template
@@ -0,0 +1,73 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-gen-meth-static-
+name: static class expression generator method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(/*{ error }*/, function() {
+ C.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-expr-gen-meth.template b/src/function-forms/error/cls-expr-gen-meth.template
new file mode 100644
index 000000000..5dbf2727a
--- /dev/null
+++ b/src/function-forms/error/cls-expr-gen-meth.template
@@ -0,0 +1,73 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-gen-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(/*{ error }*/, function() {
+ C.prototype.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-expr-meth-static.template b/src/function-forms/error/cls-expr-meth-static.template
new file mode 100644
index 000000000..0be31534e
--- /dev/null
+++ b/src/function-forms/error/cls-expr-meth-static.template
@@ -0,0 +1,70 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-meth-static-
+name: static class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ static method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(/*{ error }*/, function() {
+ C.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/cls-expr-meth.template b/src/function-forms/error/cls-expr-meth.template
new file mode 100644
index 000000000..75c353d24
--- /dev/null
+++ b/src/function-forms/error/cls-expr-meth.template
@@ -0,0 +1,70 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var C = class {
+ method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(/*{ error }*/, function() {
+ C.prototype.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/error/func-decl.template b/src/function-forms/error/func-decl.template
new file mode 100644
index 000000000..d57e6fa54
--- /dev/null
+++ b/src/function-forms/error/func-decl.template
@@ -0,0 +1,48 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/function/params-
+name: function declaration
+esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
+info: |
+ FunctionDeclaration :
+ function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ [...]
+ 3. Let F be FunctionCreate(Normal, FormalParameters, FunctionBody,
+ scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+function f(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+}
+assert.throws(/*{ error }*/, function() {
+ f(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'function body not evaluated');
diff --git a/src/function-forms/error/func-expr.template b/src/function-forms/error/func-expr.template
new file mode 100644
index 000000000..62155d917
--- /dev/null
+++ b/src/function-forms/error/func-expr.template
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/function/params-
+name: function expression
+esid: sec-function-definitions-runtime-semantics-evaluation
+info: |
+ FunctionExpression : function ( FormalParameters ) { FunctionBody }
+
+ [...]
+ 3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
+ scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var f;
+f = function(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+assert.throws(/*{ error }*/, function() {
+ f(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'function body not evaluated');
diff --git a/src/function-forms/error/gen-func-decl.template b/src/function-forms/error/gen-func-decl.template
new file mode 100644
index 000000000..9b414763a
--- /dev/null
+++ b/src/function-forms/error/gen-func-decl.template
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/generators/params-
+name: generator function declaration
+esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
+info: |
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+
+ [...]
+ 2. Let F be GeneratorFunctionCreate(Normal, FormalParameters,
+ GeneratorBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+function* f(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+}
+
+assert.throws(/*{ error }*/, function() {
+ f(/*{ args }*/);
+});
+
+assert.sameValue(callCount, 0, 'generator function body not evaluated');
diff --git a/src/function-forms/error/gen-func-expr.template b/src/function-forms/error/gen-func-expr.template
new file mode 100644
index 000000000..411c6db75
--- /dev/null
+++ b/src/function-forms/error/gen-func-expr.template
@@ -0,0 +1,49 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/generators/params-
+name: generator function expression
+esid: sec-generator-function-definitions-runtime-semantics-evaluation
+info: |
+ GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
+
+ [...]
+ 3. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
+ GeneratorBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var f;
+f = function*(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+};
+
+assert.throws(/*{ error }*/, function() {
+ f(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'generator function body not evaluated');
diff --git a/src/function-forms/error/gen-meth.template b/src/function-forms/error/gen-meth.template
new file mode 100644
index 000000000..bf6f0cc23
--- /dev/null
+++ b/src/function-forms/error/gen-meth.template
@@ -0,0 +1,55 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/object/method-definition/params-gen-meth-
+name: generator method
+esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
+info: |
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var obj = {
+ *method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(/*{ error }*/, function() {
+ obj.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'generator method body not evaluated');
diff --git a/src/function-forms/error/meth.template b/src/function-forms/error/meth.template
new file mode 100644
index 000000000..6d923cc46
--- /dev/null
+++ b/src/function-forms/error/meth.template
@@ -0,0 +1,52 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/object/method-definition/params-meth-
+name: method
+esid: sec-runtime-semantics-definemethod
+info: |
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters,
+ FunctionBody, scope, strict). If functionPrototype was passed as a
+ parameter then pass its value as the functionPrototype optional argument
+ of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+var callCount = 0;
+var obj = {
+ method(/*{ params }*/) {
+ /*{ body }*/
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(/*{ error }*/, function() {
+ obj.method(/*{ args }*/);
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
diff --git a/src/function-forms/syntax/arrow-function.template b/src/function-forms/syntax/arrow-function.template
new file mode 100644
index 000000000..c1ada16c8
--- /dev/null
+++ b/src/function-forms/syntax/arrow-function.template
@@ -0,0 +1,40 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/arrow-function/params-
+name: arrow function expression
+esid: sec-arrow-function-definitions-runtime-semantics-evaluation
+info: |
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ [...]
+ 4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+0, (/*{ params }*/) => {
+ /*{ body }*/
+};
diff --git a/src/function-forms/syntax/async-gen-func-decl.template b/src/function-forms/syntax/async-gen-func-decl.template
new file mode 100644
index 000000000..905c4a9a8
--- /dev/null
+++ b/src/function-forms/syntax/async-gen-func-decl.template
@@ -0,0 +1,21 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/statements/async-generator/params-
+name: async generator function declaration
+esid: sec-asyncgenerator-definitions-instantiatefunctionobject
+info: |
+ AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
+ ( FormalParameters ) { AsyncGeneratorBody }
+
+ [...]
+ 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
+ scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+async function* f(/*{ params }*/) {
+ /*{ body }*/
+}
diff --git a/src/function-forms/syntax/async-gen-func-expr.template b/src/function-forms/syntax/async-gen-func-expr.template
new file mode 100644
index 000000000..681ca4872
--- /dev/null
+++ b/src/function-forms/syntax/async-gen-func-expr.template
@@ -0,0 +1,21 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/expressions/async-generator/params-
+name: async generator function expression
+esid: sec-asyncgenerator-definitions-evaluation
+info: |
+ AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
+ AsyncGeneratorBody }
+
+ [...]
+ 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+0, async function*(/*{ params }*/) {
+ /*{ body }*/
+};
diff --git a/src/function-forms/syntax/async-gen-meth.template b/src/function-forms/syntax/async-gen-meth.template
new file mode 100644
index 000000000..fbec15467
--- /dev/null
+++ b/src/function-forms/syntax/async-gen-meth.template
@@ -0,0 +1,27 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/object/method-definition/params-async-gen-meth-
+name: async generator method
+esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
+info: |
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+0, {
+ async *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+};
diff --git a/src/function-forms/syntax/async-gen-named-func-expr.template b/src/function-forms/syntax/async-gen-named-func-expr.template
new file mode 100644
index 000000000..ba804028b
--- /dev/null
+++ b/src/function-forms/syntax/async-gen-named-func-expr.template
@@ -0,0 +1,21 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/expressions/async-generator/params-named-
+name: async generator named function expression
+esid: sec-asyncgenerator-definitions-evaluation
+info: |
+ AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
+ ( FormalParameters ) { AsyncGeneratorBody }
+
+ [...]
+ 7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
+ AsyncGeneratorBody, funcEnv, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+0, async function* g(/*{ params }*/) {
+ /*{ body }*/
+};
diff --git a/src/function-forms/syntax/cls-decl-async-gen-meth-static.template b/src/function-forms/syntax/cls-decl-async-gen-meth-static.template
new file mode 100644
index 000000000..ecd372f7a
--- /dev/null
+++ b/src/function-forms/syntax/cls-decl-async-gen-meth-static.template
@@ -0,0 +1,46 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+path: language/statements/class/params-async-gen-meth-static-
+name: static class expression generator method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+class C {
+ static async *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+}
diff --git a/src/function-forms/syntax/cls-decl-async-gen-meth.template b/src/function-forms/syntax/cls-decl-async-gen-meth.template
new file mode 100644
index 000000000..20f4527e0
--- /dev/null
+++ b/src/function-forms/syntax/cls-decl-async-gen-meth.template
@@ -0,0 +1,45 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-async-gen-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+class C {
+ async *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+}
diff --git a/src/function-forms/syntax/cls-decl-gen-meth-static.template b/src/function-forms/syntax/cls-decl-gen-meth-static.template
new file mode 100644
index 000000000..674b9951d
--- /dev/null
+++ b/src/function-forms/syntax/cls-decl-gen-meth-static.template
@@ -0,0 +1,64 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-gen-meth-static-
+name: static class expression generator method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+class C {
+ static *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+}
diff --git a/src/function-forms/syntax/cls-decl-gen-meth.template b/src/function-forms/syntax/cls-decl-gen-meth.template
new file mode 100644
index 000000000..58fcf0596
--- /dev/null
+++ b/src/function-forms/syntax/cls-decl-gen-meth.template
@@ -0,0 +1,64 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-gen-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+class C {
+ *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+}
diff --git a/src/function-forms/syntax/cls-decl-meth-static.template b/src/function-forms/syntax/cls-decl-meth-static.template
new file mode 100644
index 000000000..b31325bc0
--- /dev/null
+++ b/src/function-forms/syntax/cls-decl-meth-static.template
@@ -0,0 +1,62 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-meth-static-
+name: static class expression method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+class C {
+ static method(/*{ params }*/) {
+ /*{ body }*/
+ }
+}
diff --git a/src/function-forms/syntax/cls-decl-meth.template b/src/function-forms/syntax/cls-decl-meth.template
new file mode 100644
index 000000000..e33de83c6
--- /dev/null
+++ b/src/function-forms/syntax/cls-decl-meth.template
@@ -0,0 +1,62 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/class/params-meth-
+name: class expression method
+esid: sec-runtime-semantics-bindingclassdeclarationevaluation
+info: |
+ ClassDeclaration : class BindingIdentifier ClassTail
+
+ 1. Let className be StringValue of BindingIdentifier.
+ 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
+ argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+class C {
+ method(/*{ params }*/) {
+ /*{ body }*/
+ }
+}
diff --git a/src/function-forms/syntax/cls-expr-async-gen-meth-static.template b/src/function-forms/syntax/cls-expr-async-gen-meth-static.template
new file mode 100644
index 000000000..25c81044a
--- /dev/null
+++ b/src/function-forms/syntax/cls-expr-async-gen-meth-static.template
@@ -0,0 +1,46 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-async-gen-meth-static-
+name: static class expression async generator method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+0, class {
+ static async *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+};
diff --git a/src/function-forms/syntax/cls-expr-async-gen-meth.template b/src/function-forms/syntax/cls-expr-async-gen-meth.template
new file mode 100644
index 000000000..c3ca6b513
--- /dev/null
+++ b/src/function-forms/syntax/cls-expr-async-gen-meth.template
@@ -0,0 +1,46 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-async-gen-meth-
+name: class expression async generator method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+features: [async-iteration]
+---*/
+
+0, class {
+ async *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+};
diff --git a/src/function-forms/syntax/cls-expr-gen-meth-static.template b/src/function-forms/syntax/cls-expr-gen-meth-static.template
new file mode 100644
index 000000000..3864b123b
--- /dev/null
+++ b/src/function-forms/syntax/cls-expr-gen-meth-static.template
@@ -0,0 +1,66 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-gen-meth-static-
+name: static class expression generator method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+0, class {
+ static *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+};
diff --git a/src/function-forms/syntax/cls-expr-gen-meth.template b/src/function-forms/syntax/cls-expr-gen-meth.template
new file mode 100644
index 000000000..dfd8b3260
--- /dev/null
+++ b/src/function-forms/syntax/cls-expr-gen-meth.template
@@ -0,0 +1,66 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-gen-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
+
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+0, class {
+ *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+};
diff --git a/src/function-forms/syntax/cls-expr-meth-static.template b/src/function-forms/syntax/cls-expr-meth-static.template
new file mode 100644
index 000000000..b2f715629
--- /dev/null
+++ b/src/function-forms/syntax/cls-expr-meth-static.template
@@ -0,0 +1,63 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-meth-static-
+name: static class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation for
+ m with arguments F and false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+0, class {
+ static method(/*{ params }*/) {
+ /*{ body }*/
+ }
+};
diff --git a/src/function-forms/syntax/cls-expr-meth.template b/src/function-forms/syntax/cls-expr-meth.template
new file mode 100644
index 000000000..d303acfbe
--- /dev/null
+++ b/src/function-forms/syntax/cls-expr-meth.template
@@ -0,0 +1,63 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/class/params-meth-
+name: class expression method
+esid: sec-class-definitions-runtime-semantics-evaluation
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ i. Let status be the result of performing
+ PropertyDefinitionEvaluation for m with arguments proto and
+ false.
+ [...]
+
+ 14.3.8 Runtime Semantics: DefineMethod
+
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
+ scope, strict). If functionPrototype was passed as a parameter then pass its
+ value as the functionPrototype optional argument of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+0, class {
+ method(/*{ params }*/) {
+ /*{ body }*/
+ }
+};
diff --git a/src/function-forms/syntax/func-decl.template b/src/function-forms/syntax/func-decl.template
new file mode 100644
index 000000000..a87474e5b
--- /dev/null
+++ b/src/function-forms/syntax/func-decl.template
@@ -0,0 +1,42 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/function/params-
+name: function declaration
+esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
+info: |
+ FunctionDeclaration :
+ function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ [...]
+ 3. Let F be FunctionCreate(Normal, FormalParameters, FunctionBody,
+ scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+function f(/*{ params }*/) {
+ /*{ body }*/
+}
diff --git a/src/function-forms/syntax/func-expr.template b/src/function-forms/syntax/func-expr.template
new file mode 100644
index 000000000..1c078c507
--- /dev/null
+++ b/src/function-forms/syntax/func-expr.template
@@ -0,0 +1,41 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/function/params-
+name: function expression
+esid: sec-function-definitions-runtime-semantics-evaluation
+info: |
+ FunctionExpression : function ( FormalParameters ) { FunctionBody }
+
+ [...]
+ 3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
+ scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+0, function(/*{ params }*/) {
+ /*{ body }*/
+};
diff --git a/src/function-forms/syntax/gen-func-decl.template b/src/function-forms/syntax/gen-func-decl.template
new file mode 100644
index 000000000..ce97faca8
--- /dev/null
+++ b/src/function-forms/syntax/gen-func-decl.template
@@ -0,0 +1,41 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/statements/generators/params-
+name: generator function declaration
+esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
+info: |
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+
+ [...]
+ 2. Let F be GeneratorFunctionCreate(Normal, FormalParameters,
+ GeneratorBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+function* f(/*{ params }*/) {
+ /*{ body }*/
+}
diff --git a/src/function-forms/syntax/gen-func-expr.template b/src/function-forms/syntax/gen-func-expr.template
new file mode 100644
index 000000000..5a80646ec
--- /dev/null
+++ b/src/function-forms/syntax/gen-func-expr.template
@@ -0,0 +1,41 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/generators/params-
+name: generator function expression
+esid: sec-generator-function-definitions-runtime-semantics-evaluation
+info: |
+ GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
+
+ [...]
+ 3. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
+ GeneratorBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+0, function*(/*{ params }*/) {
+ /*{ body }*/
+};
diff --git a/src/function-forms/syntax/gen-meth.template b/src/function-forms/syntax/gen-meth.template
new file mode 100644
index 000000000..c52cdb04a
--- /dev/null
+++ b/src/function-forms/syntax/gen-meth.template
@@ -0,0 +1,48 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/object/method-definition/params-gen-meth-
+name: generator method
+esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
+info: |
+ GeneratorMethod :
+ * PropertyName ( StrictFormalParameters ) { GeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this GeneratorMethod is strict mode code,
+ let strict be true. Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be GeneratorFunctionCreate(Method,
+ StrictFormalParameters, GeneratorBody, scope, strict).
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+0, {
+ *method(/*{ params }*/) {
+ /*{ body }*/
+ }
+};
diff --git a/src/function-forms/syntax/meth.template b/src/function-forms/syntax/meth.template
new file mode 100644
index 000000000..02f4909ca
--- /dev/null
+++ b/src/function-forms/syntax/meth.template
@@ -0,0 +1,45 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+path: language/expressions/object/method-definition/params-meth-
+name: method
+esid: sec-runtime-semantics-definemethod
+info: |
+ MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
+
+ [...]
+ 6. Let closure be FunctionCreate(kind, StrictFormalParameters,
+ FunctionBody, scope, strict). If functionPrototype was passed as a
+ parameter then pass its value as the functionPrototype optional argument
+ of FunctionCreate.
+ [...]
+
+ 9.2.1 [[Call]] ( thisArgument, argumentsList)
+
+ [...]
+ 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
+ [...]
+
+ 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
+
+ 1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
+ [...]
+
+ 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
+
+ [...]
+ 23. Let iteratorRecord be Record {[[iterator]]:
+ CreateListIterator(argumentsList), [[done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ b. Let formalStatus be IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+---*/
+
+0, {
+ method(/*{ params }*/) {
+ /*{ body }*/
+ }
+};
diff --git a/src/function-forms/trailing-comma-dflt-param.case b/src/function-forms/trailing-comma-dflt-param.case
new file mode 100644
index 000000000..7915023e6
--- /dev/null
+++ b/src/function-forms/trailing-comma-dflt-param.case
@@ -0,0 +1,23 @@
+// Copyright (C) 2016 Jeff Morrison. All rights reserved.
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: A trailing comma should not increase the respective length, using default parameters
+template: default
+info: |
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+//- params
+a, b = 39,
+//- args
+42, undefined, 1
+//- body
+assert.sameValue(a, 42);
+assert.sameValue(b, 39);
+//- teardown
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/src/function-forms/trailing-comma-multiple-param.case b/src/function-forms/trailing-comma-multiple-param.case
new file mode 100644
index 000000000..c6f565ccf
--- /dev/null
+++ b/src/function-forms/trailing-comma-multiple-param.case
@@ -0,0 +1,23 @@
+// Copyright (C) 2016 Jeff Morrison. All rights reserved.
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: A trailing comma should not increase the respective length, using multiple parameters
+template: default
+info: |
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+//- params
+a, b,
+//- args
+42, 39, 1
+//- body
+assert.sameValue(a, 42);
+assert.sameValue(b, 39);
+//- teardown
+assert.sameValue(ref.length, 2, 'length is properly set');
diff --git a/src/function-forms/trailing-comma-rest-early-error.case b/src/function-forms/trailing-comma-rest-early-error.case
new file mode 100644
index 000000000..42bdf3f86
--- /dev/null
+++ b/src/function-forms/trailing-comma-rest-early-error.case
@@ -0,0 +1,24 @@
+// Copyright (C) 2016 Jeff Morrison. All rights reserved.
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: It's a syntax error if a FunctionRestParameter is followed by a trailing comma
+template: syntax
+negative:
+ phase: early
+ type: SyntaxError
+info: |
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+
+//- params
+...a,
diff --git a/src/function-forms/trailing-comma-single-param.case b/src/function-forms/trailing-comma-single-param.case
new file mode 100644
index 000000000..defbc72df
--- /dev/null
+++ b/src/function-forms/trailing-comma-single-param.case
@@ -0,0 +1,22 @@
+// Copyright (C) 2016 Jeff Morrison. All rights reserved.
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+desc: A trailing comma should not increase the respective length, using a single parameter
+template: default
+info: |
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+//- params
+a,
+//- args
+42, 39
+//- body
+assert.sameValue(a, 42);
+//- teardown
+assert.sameValue(ref.length, 1, 'length is properly set');