Generate tests

This commit is contained in:
Leonardo Balter 2017-03-14 14:34:20 -04:00
parent c37a242057
commit 7522a29f31
No known key found for this signature in database
GPG Key ID: 4191D7EB5EC82FF7
105 changed files with 4537 additions and 39 deletions

View File

@ -60,8 +60,9 @@ var nullCount = 0;
var objCount = 0; var objCount = 0;
var callCount = 0; var callCount = 0;
var f; // Stores a reference `ref` for case evaluation
f = (aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) => { var ref;
ref = (aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) => {
assert.sameValue(aFalse, false); assert.sameValue(aFalse, false);
assert.sameValue(aString, ''); assert.sameValue(aString, '');
assert.sameValue(aNaN, NaN); assert.sameValue(aNaN, NaN);
@ -71,7 +72,7 @@ f = (aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1,
callCount = callCount + 1; callCount = callCount + 1;
}; };
f(false, '', NaN, 0, null, obj); ref(false, '', NaN, 0, null, obj);
assert.sameValue(callCount, 1, 'arrow function invoked exactly once'); assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -53,13 +53,14 @@ info: |
---*/ ---*/
var callCount = 0; var callCount = 0;
var f; // Stores a reference `ref` for case evaluation
f = (fromLiteral = 23, fromExpr = 45, fromHole = 99) => { var ref;
ref = (fromLiteral = 23, fromExpr = 45, fromHole = 99) => {
assert.sameValue(fromLiteral, 23); assert.sameValue(fromLiteral, 23);
assert.sameValue(fromExpr, 45); assert.sameValue(fromExpr, 45);
assert.sameValue(fromHole, 99); assert.sameValue(fromHole, 99);
callCount = callCount + 1; callCount = callCount + 1;
}; };
f(undefined, void 0); ref(undefined, void 0);
assert.sameValue(callCount, 1, 'arrow function invoked exactly once'); assert.sameValue(callCount, 1, 'arrow function invoked exactly once');

View File

@ -50,13 +50,14 @@ info: |
var x = 0; var x = 0;
var callCount = 0; var callCount = 0;
var f; // Stores a reference `ref` for case evaluation
f = (x, y = x, z = y) => { var ref;
ref = (x, y = x, z = y) => {
assert.sameValue(x, 3, 'first argument value'); assert.sameValue(x, 3, 'first argument value');
assert.sameValue(y, 3, 'second argument value'); assert.sameValue(y, 3, 'second argument value');
assert.sameValue(z, 3, 'third argument value'); assert.sameValue(z, 3, 'third argument value');
callCount = callCount + 1; callCount = callCount + 1;
}; };
f(3); ref(3);
assert.sameValue(callCount, 1, 'arrow function invoked exactly once'); assert.sameValue(callCount, 1, 'arrow function invoked exactly once');

View File

@ -0,0 +1,59 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/arrow-function.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (arrow function expression)
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
es6id: 14.2.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
var ref;
ref = (a, b = 39,) => {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
};
ref(42, undefined, 1);
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,59 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/arrow-function.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (arrow function expression)
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
es6id: 14.2.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
var ref;
ref = (a, b,) => {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
};
ref(42, 39, 1);
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,57 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/arrow-function.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (arrow function expression)
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
es6id: 14.2.16
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
0, (...a,) => {
};

View File

@ -0,0 +1,58 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/arrow-function.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (arrow function expression)
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
es6id: 14.2.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
var ref;
ref = (a,) => {
assert.sameValue(a, 42);
callCount = callCount + 1;
};
ref(42, 39);
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -98,6 +98,9 @@ var C = class {
C.prototype.method(false, '', NaN, 0, null, obj).next(); C.prototype.method(false, '', NaN, 0, null, obj).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -88,4 +88,7 @@ var C = class {
C.prototype.method(undefined, void 0).next(); C.prototype.method(undefined, void 0).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -85,4 +85,7 @@ var C = class {
C.prototype.method(3).next(); C.prototype.method(3).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -98,6 +98,9 @@ var C = class {
C.method(false, '', NaN, 0, null, obj).next(); C.method(false, '', NaN, 0, null, obj).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -88,4 +88,7 @@ var C = class {
C.method(undefined, void 0).next(); C.method(undefined, void 0).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -85,4 +85,7 @@ var C = class {
C.method(3).next(); C.method(3).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -0,0 +1,87 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/cls-expr-gen-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (static class expression generator method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
static *method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
C.method(42, undefined, 1).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,87 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/cls-expr-gen-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (static class expression generator method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
static *method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
C.method(42, 39, 1).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,83 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/cls-expr-gen-meth-static.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression generator method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
0, class {
static *method(...a,) {
}
};

View File

@ -0,0 +1,86 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/cls-expr-gen-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (static class expression generator method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
static *method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
};
C.method(42, 39).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,87 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/cls-expr-gen-meth.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
*method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
C.prototype.method(42, undefined, 1).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,87 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/cls-expr-gen-meth.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
*method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
C.prototype.method(42, 39, 1).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,83 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/cls-expr-gen-meth.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
0, class {
*method(...a,) {
}
};

View File

@ -0,0 +1,86 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/cls-expr-gen-meth.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
*method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
};
C.prototype.method(42, 39).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -95,6 +95,9 @@ var C = class {
C.prototype.method(false, '', NaN, 0, null, obj); C.prototype.method(false, '', NaN, 0, null, obj);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -85,4 +85,7 @@ var C = class {
C.prototype.method(undefined, void 0); C.prototype.method(undefined, void 0);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -82,4 +82,7 @@ var C = class {
C.prototype.method(3); C.prototype.method(3);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -95,6 +95,9 @@ var C = class {
C.method(false, '', NaN, 0, null, obj); C.method(false, '', NaN, 0, null, obj);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -85,4 +85,7 @@ var C = class {
C.method(undefined, void 0); C.method(undefined, void 0);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -82,4 +82,7 @@ var C = class {
C.method(3); C.method(3);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -0,0 +1,84 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/cls-expr-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (static class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
static method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
C.method(42, undefined, 1);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,84 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/cls-expr-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (static class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
static method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
C.method(42, 39, 1);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,80 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/cls-expr-meth-static.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
0, class {
static method(...a,) {
}
};

View File

@ -0,0 +1,83 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/cls-expr-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (static class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
static method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
};
C.method(42, 39);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,84 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/cls-expr-meth.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
C.prototype.method(42, undefined, 1);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,84 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/cls-expr-meth.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
C.prototype.method(42, 39, 1);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,80 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/cls-expr-meth.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
0, class {
method(...a,) {
}
};

View File

@ -0,0 +1,83 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/cls-expr-meth.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var C = class {
method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
};
C.prototype.method(42, 39);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -61,8 +61,9 @@ var nullCount = 0;
var objCount = 0; var objCount = 0;
var callCount = 0; var callCount = 0;
var f; // Stores a reference `ref` for case evaluation
f = function(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) { var ref;
ref = function(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
assert.sameValue(aFalse, false); assert.sameValue(aFalse, false);
assert.sameValue(aString, ''); assert.sameValue(aString, '');
assert.sameValue(aNaN, NaN); assert.sameValue(aNaN, NaN);
@ -72,7 +73,7 @@ f = function(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCoun
callCount = callCount + 1; callCount = callCount + 1;
}; };
f(false, '', NaN, 0, null, obj); ref(false, '', NaN, 0, null, obj);
assert.sameValue(callCount, 1, 'function invoked exactly once'); assert.sameValue(callCount, 1, 'function invoked exactly once');

View File

@ -54,14 +54,15 @@ info: |
---*/ ---*/
var callCount = 0; var callCount = 0;
var f; // Stores a reference `ref` for case evaluation
f = function(fromLiteral = 23, fromExpr = 45, fromHole = 99) { var ref;
ref = function(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
assert.sameValue(fromLiteral, 23); assert.sameValue(fromLiteral, 23);
assert.sameValue(fromExpr, 45); assert.sameValue(fromExpr, 45);
assert.sameValue(fromHole, 99); assert.sameValue(fromHole, 99);
callCount = callCount + 1; callCount = callCount + 1;
}; };
f(undefined, void 0); ref(undefined, void 0);
assert.sameValue(callCount, 1, 'function invoked exactly once'); assert.sameValue(callCount, 1, 'function invoked exactly once');

View File

@ -51,14 +51,15 @@ info: |
var x = 0; var x = 0;
var callCount = 0; var callCount = 0;
var f; // Stores a reference `ref` for case evaluation
f = function(x, y = x, z = y) { var ref;
ref = function(x, y = x, z = y) {
assert.sameValue(x, 3, 'first argument value'); assert.sameValue(x, 3, 'first argument value');
assert.sameValue(y, 3, 'second argument value'); assert.sameValue(y, 3, 'second argument value');
assert.sameValue(z, 3, 'third argument value'); assert.sameValue(z, 3, 'third argument value');
callCount = callCount + 1; callCount = callCount + 1;
}; };
f(3); ref(3);
assert.sameValue(callCount, 1, 'function invoked exactly once'); assert.sameValue(callCount, 1, 'function invoked exactly once');

View File

@ -0,0 +1,61 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/func-expr.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
es6id: 14.1.20
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
var ref;
ref = function(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
};
ref(42, undefined, 1);
assert.sameValue(callCount, 1, 'function invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,61 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/func-expr.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
es6id: 14.1.20
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
var ref;
ref = function(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
};
ref(42, 39, 1);
assert.sameValue(callCount, 1, 'function invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,58 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/func-expr.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
es6id: 14.1.20
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
0, function(...a,) {
};

View File

@ -0,0 +1,60 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/func-expr.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
es6id: 14.1.20
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
var ref;
ref = function(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
};
ref(42, 39);
assert.sameValue(callCount, 1, 'function invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -61,8 +61,9 @@ var nullCount = 0;
var objCount = 0; var objCount = 0;
var callCount = 0; var callCount = 0;
var f; // Stores a reference `ref` for case evaluation
f = function*(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) { var ref;
ref = function*(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
assert.sameValue(aFalse, false); assert.sameValue(aFalse, false);
assert.sameValue(aString, ''); assert.sameValue(aString, '');
assert.sameValue(aNaN, NaN); assert.sameValue(aNaN, NaN);
@ -72,7 +73,7 @@ f = function*(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCou
callCount = callCount + 1; callCount = callCount + 1;
}; };
f(false, '', NaN, 0, null, obj).next(); ref(false, '', NaN, 0, null, obj).next();
assert.sameValue(callCount, 1, 'generator function invoked exactly once'); assert.sameValue(callCount, 1, 'generator function invoked exactly once');

View File

@ -54,14 +54,15 @@ info: |
---*/ ---*/
var callCount = 0; var callCount = 0;
var f; // Stores a reference `ref` for case evaluation
f = function*(fromLiteral = 23, fromExpr = 45, fromHole = 99) { var ref;
ref = function*(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
assert.sameValue(fromLiteral, 23); assert.sameValue(fromLiteral, 23);
assert.sameValue(fromExpr, 45); assert.sameValue(fromExpr, 45);
assert.sameValue(fromHole, 99); assert.sameValue(fromHole, 99);
callCount = callCount + 1; callCount = callCount + 1;
}; };
f(undefined, void 0).next(); ref(undefined, void 0).next();
assert.sameValue(callCount, 1, 'generator function invoked exactly once'); assert.sameValue(callCount, 1, 'generator function invoked exactly once');

View File

@ -51,14 +51,15 @@ info: |
var x = 0; var x = 0;
var callCount = 0; var callCount = 0;
var f; // Stores a reference `ref` for case evaluation
f = function*(x, y = x, z = y) { var ref;
ref = function*(x, y = x, z = y) {
assert.sameValue(x, 3, 'first argument value'); assert.sameValue(x, 3, 'first argument value');
assert.sameValue(y, 3, 'second argument value'); assert.sameValue(y, 3, 'second argument value');
assert.sameValue(z, 3, 'third argument value'); assert.sameValue(z, 3, 'third argument value');
callCount = callCount + 1; callCount = callCount + 1;
}; };
f(3).next(); ref(3).next();
assert.sameValue(callCount, 1, 'generator function invoked exactly once'); assert.sameValue(callCount, 1, 'generator function invoked exactly once');

View File

@ -0,0 +1,61 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/gen-func-expr.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (generator function expression)
esid: sec-generator-function-definitions-runtime-semantics-evaluation
es6id: 14.4.14
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
var ref;
ref = function*(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
};
ref(42, undefined, 1).next();
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,61 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/gen-func-expr.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (generator function expression)
esid: sec-generator-function-definitions-runtime-semantics-evaluation
es6id: 14.4.14
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
var ref;
ref = function*(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
};
ref(42, 39, 1).next();
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,58 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/gen-func-expr.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (generator function expression)
esid: sec-generator-function-definitions-runtime-semantics-evaluation
es6id: 14.4.14
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
0, function*(...a,) {
};

View File

@ -0,0 +1,60 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/gen-func-expr.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (generator function expression)
esid: sec-generator-function-definitions-runtime-semantics-evaluation
es6id: 14.4.14
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
var ref;
ref = function*(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
};
ref(42, 39).next();
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -80,6 +80,9 @@ var obj = {
obj.method(false, '', NaN, 0, null, obj).next(); obj.method(false, '', NaN, 0, null, obj).next();
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'generator method invoked exactly once'); assert.sameValue(callCount, 1, 'generator method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -70,4 +70,7 @@ var obj = {
obj.method(undefined, void 0).next(); obj.method(undefined, void 0).next();
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'generator method invoked exactly once'); assert.sameValue(callCount, 1, 'generator method invoked exactly once');

View File

@ -67,4 +67,7 @@ var obj = {
obj.method(3).next(); obj.method(3).next();
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'generator method invoked exactly once'); assert.sameValue(callCount, 1, 'generator method invoked exactly once');

View File

@ -0,0 +1,69 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/gen-meth.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (generator method)
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
es6id: 14.4.13
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var obj = {
*method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
obj.method(42, undefined, 1).next();
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'generator method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,69 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/gen-meth.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (generator method)
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
es6id: 14.4.13
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var obj = {
*method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
obj.method(42, 39, 1).next();
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'generator method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,65 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/gen-meth.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (generator method)
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
es6id: 14.4.13
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
0, {
*method(...a,) {
}
};

View File

@ -0,0 +1,68 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/gen-meth.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (generator method)
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
es6id: 14.4.13
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var obj = {
*method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
};
obj.method(42, 39).next();
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'generator method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -77,6 +77,9 @@ var obj = {
obj.method(false, '', NaN, 0, null, obj); obj.method(false, '', NaN, 0, null, obj);
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -67,4 +67,7 @@ var obj = {
obj.method(undefined, void 0); obj.method(undefined, void 0);
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -64,4 +64,7 @@ var obj = {
obj.method(3); obj.method(3);
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -0,0 +1,66 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/meth.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (method)
esid: sec-runtime-semantics-definemethod
es6id: 14.3.8
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var obj = {
method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
obj.method(42, undefined, 1);
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,66 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/meth.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (method)
esid: sec-runtime-semantics-definemethod
es6id: 14.3.8
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var obj = {
method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
};
obj.method(42, 39, 1);
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,62 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/meth.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (method)
esid: sec-runtime-semantics-definemethod
es6id: 14.3.8
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
0, {
method(...a,) {
}
};

View File

@ -0,0 +1,65 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/meth.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (method)
esid: sec-runtime-semantics-definemethod
es6id: 14.3.8
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
var obj = {
method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
};
obj.method(42, 39);
// Stores a reference `ref` for case evaluation
var ref = obj.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -96,6 +96,9 @@ class C {
C.prototype.method(false, '', NaN, 0, null, obj).next(); C.prototype.method(false, '', NaN, 0, null, obj).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -86,4 +86,7 @@ class C {
C.prototype.method(undefined, void 0).next(); C.prototype.method(undefined, void 0).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -83,4 +83,7 @@ class C {
C.prototype.method(3).next(); C.prototype.method(3).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -96,6 +96,9 @@ class C {
C.method(false, '', NaN, 0, null, obj).next(); C.method(false, '', NaN, 0, null, obj).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -86,4 +86,7 @@ class C {
C.method(undefined, void 0).next(); C.method(undefined, void 0).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -83,4 +83,7 @@ class C {
C.method(3).next(); C.method(3).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -0,0 +1,85 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/cls-decl-gen-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (static class expression generator method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
static *method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
}
C.method(42, undefined, 1).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,85 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/cls-decl-gen-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (static class expression generator method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
static *method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
}
C.method(42, 39, 1).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,81 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/cls-decl-gen-meth-static.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression generator method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
class C {
static *method(...a,) {
}
}

View File

@ -0,0 +1,84 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/cls-decl-gen-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (static class expression generator method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
static *method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
}
C.method(42, 39).next();
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,85 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/cls-decl-gen-meth.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
*method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
}
C.prototype.method(42, undefined, 1).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,85 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/cls-decl-gen-meth.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
*method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
}
C.prototype.method(42, 39, 1).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,81 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/cls-decl-gen-meth.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
class C {
*method(...a,) {
}
}

View File

@ -0,0 +1,84 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/cls-decl-gen-meth.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
*method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
}
C.prototype.method(42, 39).next();
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -94,6 +94,9 @@ class C {
C.prototype.method(false, '', NaN, 0, null, obj); C.prototype.method(false, '', NaN, 0, null, obj);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -84,4 +84,7 @@ class C {
C.prototype.method(undefined, void 0); C.prototype.method(undefined, void 0);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -81,4 +81,7 @@ class C {
C.prototype.method(3); C.prototype.method(3);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -94,6 +94,9 @@ class C {
C.method(false, '', NaN, 0, null, obj); C.method(false, '', NaN, 0, null, obj);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(falseCount, 0, 'initializer not evaluated: false'); assert.sameValue(falseCount, 0, 'initializer not evaluated: false');

View File

@ -84,4 +84,7 @@ class C {
C.method(undefined, void 0); C.method(undefined, void 0);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -81,4 +81,7 @@ class C {
C.method(3); C.method(3);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once'); assert.sameValue(callCount, 1, 'method invoked exactly once');

View File

@ -0,0 +1,83 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/cls-decl-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (static class expression method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
static method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
}
C.method(42, undefined, 1);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,83 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/cls-decl-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (static class expression method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
static method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
}
C.method(42, 39, 1);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,79 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/cls-decl-meth-static.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
class C {
static method(...a,) {
}
}

View File

@ -0,0 +1,82 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/cls-decl-meth-static.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (static class expression method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
static method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
}
C.method(42, 39);
// Stores a reference `ref` for case evaluation
var ref = C.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,83 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/cls-decl-meth.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (class expression method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
method(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
}
C.prototype.method(42, undefined, 1);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,83 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/cls-decl-meth.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (class expression method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
method(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
}
C.prototype.method(42, 39, 1);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,79 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/cls-decl-meth.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (class expression method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
class C {
method(...a,) {
}
}

View File

@ -0,0 +1,82 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/cls-decl-meth.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (class expression method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
class C {
method(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
}
C.prototype.method(42, 39);
// Stores a reference `ref` for case evaluation
var ref = C.prototype.method;
assert.sameValue(callCount, 1, 'method invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -62,7 +62,8 @@ var nullCount = 0;
var objCount = 0; var objCount = 0;
var callCount = 0; var callCount = 0;
function f(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) { // Stores a reference `ref` for case evaluation
function ref(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
assert.sameValue(aFalse, false); assert.sameValue(aFalse, false);
assert.sameValue(aString, ''); assert.sameValue(aString, '');
assert.sameValue(aNaN, NaN); assert.sameValue(aNaN, NaN);
@ -72,7 +73,7 @@ function f(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount
callCount = callCount + 1; callCount = callCount + 1;
} }
f(false, '', NaN, 0, null, obj); ref(false, '', NaN, 0, null, obj);
assert.sameValue(callCount, 1, 'function invoked exactly once'); assert.sameValue(callCount, 1, 'function invoked exactly once');

View File

@ -55,13 +55,14 @@ info: |
---*/ ---*/
var callCount = 0; var callCount = 0;
function f(fromLiteral = 23, fromExpr = 45, fromHole = 99) { // Stores a reference `ref` for case evaluation
function ref(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
assert.sameValue(fromLiteral, 23); assert.sameValue(fromLiteral, 23);
assert.sameValue(fromExpr, 45); assert.sameValue(fromExpr, 45);
assert.sameValue(fromHole, 99); assert.sameValue(fromHole, 99);
callCount = callCount + 1; callCount = callCount + 1;
} }
f(undefined, void 0); ref(undefined, void 0);
assert.sameValue(callCount, 1, 'function invoked exactly once'); assert.sameValue(callCount, 1, 'function invoked exactly once');

View File

@ -52,13 +52,14 @@ info: |
var x = 0; var x = 0;
var callCount = 0; var callCount = 0;
function f(x, y = x, z = y) { // Stores a reference `ref` for case evaluation
function ref(x, y = x, z = y) {
assert.sameValue(x, 3, 'first argument value'); assert.sameValue(x, 3, 'first argument value');
assert.sameValue(y, 3, 'second argument value'); assert.sameValue(y, 3, 'second argument value');
assert.sameValue(z, 3, 'third argument value'); assert.sameValue(z, 3, 'third argument value');
callCount = callCount + 1; callCount = callCount + 1;
} }
f(3); ref(3);
assert.sameValue(callCount, 1, 'function invoked exactly once'); assert.sameValue(callCount, 1, 'function invoked exactly once');

View File

@ -0,0 +1,61 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-dflt-param.case
// - src/params/default/func-decl.template
/*---
description: A trailing comma should not increase the respective length, using default parameters (function declaration)
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
es6id: 14.1.19
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
function ref(a, b = 39,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
ref(42, undefined, 1);
assert.sameValue(callCount, 1, 'function invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -0,0 +1,61 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-multiple-param.case
// - src/params/default/func-decl.template
/*---
description: A trailing comma should not increase the respective length, using multiple parameters (function declaration)
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
es6id: 14.1.19
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
function ref(a, b,) {
assert.sameValue(a, 42);
assert.sameValue(b, 39);
callCount = callCount + 1;
}
ref(42, 39, 1);
assert.sameValue(callCount, 1, 'function invoked exactly once');
assert.sameValue(ref.length, 2, 'length is properly set');

View File

@ -0,0 +1,59 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-rest-early-error.case
// - src/params/syntax/func-decl.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (function declaration)
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
es6id: 14.1.19
features: [default-parameters]
flags: [generated]
negative:
phase: early
type: SyntaxError
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.
[...]
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]
---*/
function f(...a,) {
}

View File

@ -0,0 +1,60 @@
// This file was procedurally generated from the following sources:
// - src/params/trailing-comma-single-param.case
// - src/params/default/func-decl.template
/*---
description: A trailing comma should not increase the respective length, using a single parameter (function declaration)
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
es6id: 14.1.19
features: [default-parameters]
flags: [generated]
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.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
---*/
var callCount = 0;
// Stores a reference `ref` for case evaluation
function ref(a,) {
assert.sameValue(a, 42);
callCount = callCount + 1;
}
ref(42, 39);
assert.sameValue(callCount, 1, 'function invoked exactly once');
assert.sameValue(ref.length, 1, 'length is properly set');

View File

@ -61,7 +61,8 @@ var nullCount = 0;
var objCount = 0; var objCount = 0;
var callCount = 0; var callCount = 0;
function* f(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) { // Stores a reference `ref` for case evaluation
function* ref(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
assert.sameValue(aFalse, false); assert.sameValue(aFalse, false);
assert.sameValue(aString, ''); assert.sameValue(aString, '');
assert.sameValue(aNaN, NaN); assert.sameValue(aNaN, NaN);
@ -71,7 +72,7 @@ function* f(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount
callCount = callCount + 1; callCount = callCount + 1;
} }
f(false, '', NaN, 0, null, obj).next(); ref(false, '', NaN, 0, null, obj).next();
assert.sameValue(callCount, 1, 'generator function invoked exactly once'); assert.sameValue(callCount, 1, 'generator function invoked exactly once');

View File

@ -54,13 +54,14 @@ info: |
---*/ ---*/
var callCount = 0; var callCount = 0;
function* f(fromLiteral = 23, fromExpr = 45, fromHole = 99) { // Stores a reference `ref` for case evaluation
function* ref(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
assert.sameValue(fromLiteral, 23); assert.sameValue(fromLiteral, 23);
assert.sameValue(fromExpr, 45); assert.sameValue(fromExpr, 45);
assert.sameValue(fromHole, 99); assert.sameValue(fromHole, 99);
callCount = callCount + 1; callCount = callCount + 1;
} }
f(undefined, void 0).next(); ref(undefined, void 0).next();
assert.sameValue(callCount, 1, 'generator function invoked exactly once'); assert.sameValue(callCount, 1, 'generator function invoked exactly once');

Some files were not shown because too many files have changed in this diff Show More