mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Add templates for trailing comma in arguments list
Also fix destination path for generated tests And add a case for spread operator in the arguments before a trailing comma
This commit is contained in:
parent
ef77548b1c
commit
07a7ac999d
@ -4,13 +4,21 @@
|
|||||||
/*---
|
/*---
|
||||||
desc: A trailing comma should not increase the arguments.length, using multiple args
|
desc: A trailing comma should not increase the arguments.length, using multiple args
|
||||||
template: default
|
template: default
|
||||||
esid: prod-Arguments
|
|
||||||
info: |
|
info: |
|
||||||
Trailing comma in the arguments list
|
Trailing comma in the arguments list
|
||||||
|
|
||||||
12.3 Left-Hand-Side Expressions
|
Left-Hand-Side Expressions
|
||||||
|
|
||||||
Arguments[Yield, Await] : ( ArgumentList[?Yield, ?Await] , )
|
Arguments :
|
||||||
|
( )
|
||||||
|
( ArgumentList )
|
||||||
|
( ArgumentList , )
|
||||||
|
|
||||||
|
ArgumentList :
|
||||||
|
AssignmentExpression
|
||||||
|
... AssignmentExpression
|
||||||
|
ArgumentList , AssignmentExpression
|
||||||
|
ArgumentList , ... AssignmentExpression
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- args
|
//- args
|
||||||
|
@ -3,13 +3,21 @@
|
|||||||
/*---
|
/*---
|
||||||
desc: A trailing comma after null should not increase the arguments.length
|
desc: A trailing comma after null should not increase the arguments.length
|
||||||
template: default
|
template: default
|
||||||
esid: prod-Arguments
|
|
||||||
info: |
|
info: |
|
||||||
Trailing comma in the arguments list
|
Trailing comma in the arguments list
|
||||||
|
|
||||||
12.3 Left-Hand-Side Expressions
|
Left-Hand-Side Expressions
|
||||||
|
|
||||||
Arguments[Yield, Await] : ( ArgumentList[?Yield, ?Await] , )
|
Arguments :
|
||||||
|
( )
|
||||||
|
( ArgumentList )
|
||||||
|
( ArgumentList , )
|
||||||
|
|
||||||
|
ArgumentList :
|
||||||
|
AssignmentExpression
|
||||||
|
... AssignmentExpression
|
||||||
|
ArgumentList , AssignmentExpression
|
||||||
|
ArgumentList , ... AssignmentExpression
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- args
|
//- args
|
||||||
|
@ -4,13 +4,21 @@
|
|||||||
/*---
|
/*---
|
||||||
desc: A trailing comma should not increase the arguments.length, using a single arg
|
desc: A trailing comma should not increase the arguments.length, using a single arg
|
||||||
template: default
|
template: default
|
||||||
esid: prod-Arguments
|
|
||||||
info: |
|
info: |
|
||||||
Trailing comma in the arguments list
|
Trailing comma in the arguments list
|
||||||
|
|
||||||
12.3 Left-Hand-Side Expressions
|
Left-Hand-Side Expressions
|
||||||
|
|
||||||
Arguments[Yield, Await] : ( ArgumentList[?Yield, ?Await] , )
|
Arguments :
|
||||||
|
( )
|
||||||
|
( ArgumentList )
|
||||||
|
( ArgumentList , )
|
||||||
|
|
||||||
|
ArgumentList :
|
||||||
|
AssignmentExpression
|
||||||
|
... AssignmentExpression
|
||||||
|
ArgumentList , AssignmentExpression
|
||||||
|
ArgumentList , ... AssignmentExpression
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- args
|
//- args
|
||||||
|
34
src/arguments/args-trailing-comma-spread-operator.case
Normal file
34
src/arguments/args-trailing-comma-spread-operator.case
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: A trailing comma should not increase the arguments.length, using spread args
|
||||||
|
template: default
|
||||||
|
info: |
|
||||||
|
Trailing comma in the arguments list
|
||||||
|
|
||||||
|
Left-Hand-Side Expressions
|
||||||
|
|
||||||
|
Arguments :
|
||||||
|
( )
|
||||||
|
( ArgumentList )
|
||||||
|
( ArgumentList , )
|
||||||
|
|
||||||
|
ArgumentList :
|
||||||
|
AssignmentExpression
|
||||||
|
... AssignmentExpression
|
||||||
|
ArgumentList , AssignmentExpression
|
||||||
|
ArgumentList , ... AssignmentExpression
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- setup
|
||||||
|
var arr = [2, 3];
|
||||||
|
|
||||||
|
//- args
|
||||||
|
42, ...[1], ...arr,
|
||||||
|
//- body
|
||||||
|
assert.sameValue(arguments.length, 4);
|
||||||
|
assert.sameValue(arguments[0], 42);
|
||||||
|
assert.sameValue(arguments[1], 1);
|
||||||
|
assert.sameValue(arguments[2], 2);
|
||||||
|
assert.sameValue(arguments[3], 3);
|
@ -3,13 +3,21 @@
|
|||||||
/*---
|
/*---
|
||||||
desc: A trailing comma after undefined should not increase the arguments.length
|
desc: A trailing comma after undefined should not increase the arguments.length
|
||||||
template: default
|
template: default
|
||||||
esid: prod-Arguments
|
|
||||||
info: |
|
info: |
|
||||||
Trailing comma in the arguments list
|
Trailing comma in the arguments list
|
||||||
|
|
||||||
12.3 Left-Hand-Side Expressions
|
Left-Hand-Side Expressions
|
||||||
|
|
||||||
Arguments[Yield, Await] : ( ArgumentList[?Yield, ?Await] , )
|
Arguments :
|
||||||
|
( )
|
||||||
|
( ArgumentList )
|
||||||
|
( ArgumentList , )
|
||||||
|
|
||||||
|
ArgumentList :
|
||||||
|
AssignmentExpression
|
||||||
|
... AssignmentExpression
|
||||||
|
ArgumentList , AssignmentExpression
|
||||||
|
ArgumentList , ... AssignmentExpression
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- args
|
//- args
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
path: language/statements/async-generator/
|
path: language/arguments-object/cls-decl-async-gen-func-
|
||||||
name: async generator function declaration
|
name: async generator function declaration
|
||||||
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
||||||
info: |
|
info: |
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
path: language/expressions/async-generator/
|
path: language/arguments-object/cls-expr-async-gen-func-
|
||||||
name: async generator function expression
|
name: async generator function expression
|
||||||
esid: sec-asyncgenerator-definitions-evaluation
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
info: |
|
info: |
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
path: language/expressions/object/method-definition/async-gen-meth-
|
path: language/arguments-object/async-gen-meth-
|
||||||
name: async generator method
|
name: async generator method
|
||||||
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
||||||
info: |
|
info: |
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
path: language/expressions/async-generator/named-
|
path: language/arguments-object/async-gen-named-func-expr-
|
||||||
name: async generator named function expression
|
name: async generator named function expression
|
||||||
esid: sec-asyncgenerator-definitions-evaluation
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
info: |
|
info: |
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
path: language/statements/class/async-gen-meth-static-
|
path: language/arguments-object/cls-decl-async-gen-meth-static-
|
||||||
name: static class expression generator method
|
name: static class expression generator method
|
||||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||||
info: |
|
info: |
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
path: language/statements/class/async-gen-meth-
|
path: language/arguments-object/cls-decl-async-gen-meth-
|
||||||
name: class expression method
|
name: class expression method
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
info: |
|
info: |
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-decl-async-private-gen-meth-static-
|
||||||
|
name: static class expression private generator method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
Arguments :
|
||||||
|
( )
|
||||||
|
( ArgumentList )
|
||||||
|
( ArgumentList , )
|
||||||
|
|
||||||
|
ArgumentList :
|
||||||
|
AssignmentExpression
|
||||||
|
... AssignmentExpression
|
||||||
|
ArgumentList , AssignmentExpression
|
||||||
|
ArgumentList , ... AssignmentExpression
|
||||||
|
|
||||||
|
|
||||||
|
flags: [async]
|
||||||
|
features: [async-iteration, class, class-static-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static async * #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
C.method(/*{ args }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,56 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-decl-async-private-gen-meth-
|
||||||
|
name: static class declaration private generator method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
ClassDeclaration : class BindingIdentifier ClassTail
|
||||||
|
|
||||||
|
1. Let className be StringValue of BindingIdentifier.
|
||||||
|
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
||||||
|
argument className.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||||
|
|
||||||
|
21. For each ClassElement m in order from methods
|
||||||
|
a. If IsStatic of m is false, then
|
||||||
|
i. Let status be the result of performing
|
||||||
|
PropertyDefinitionEvaluation for m with arguments proto and
|
||||||
|
false.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
AsyncGeneratorMethod :
|
||||||
|
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||||
|
{ AsyncGeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||||
|
Otherwise let strict be false.
|
||||||
|
4. Let scope be the running execution context's LexicalEnvironment.
|
||||||
|
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||||
|
AsyncGeneratorBody, scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
features: [async-iteration, class, class-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
async * #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new C().method(/*{ args }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-decl-private-gen-meth-static-
|
||||||
|
name: class declaration private generator method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
9.4.4 Arguments Exotic Objects
|
||||||
|
|
||||||
|
Most ECMAScript functions make an arguments object available to their code. Depending upon the
|
||||||
|
characteristics of the function definition, its arguments object is either an ordinary object
|
||||||
|
or an arguments exotic object.
|
||||||
|
features: [generators, class, class-static-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static * #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
C.method(/*{ args }*/).next();
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
31
src/arguments/default/cls-decl-private-gen-meth.template
Normal file
31
src/arguments/default/cls-decl-private-gen-meth.template
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-decl-private-gen-meth-
|
||||||
|
name: class declaration private generator method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
9.4.4 Arguments Exotic Objects
|
||||||
|
|
||||||
|
Most ECMAScript functions make an arguments object available to their code. Depending upon the
|
||||||
|
characteristics of the function definition, its arguments object is either an ordinary object
|
||||||
|
or an arguments exotic object.
|
||||||
|
features: [generators, class, class-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
* #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new C().method(/*{ args }*/).next();
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
31
src/arguments/default/cls-decl-private-meth-static.template
Normal file
31
src/arguments/default/cls-decl-private-meth-static.template
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-decl-private-meth-static-
|
||||||
|
name: static class declaration private method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
9.4.4 Arguments Exotic Objects
|
||||||
|
|
||||||
|
Most ECMAScript functions make an arguments object available to their code. Depending upon the
|
||||||
|
characteristics of the function definition, its arguments object is either an ordinary object
|
||||||
|
or an arguments exotic object.
|
||||||
|
features: [class, class, class-static-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
C.method(/*{ args }*/);
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
31
src/arguments/default/cls-decl-private-meth.template
Normal file
31
src/arguments/default/cls-decl-private-meth.template
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-decl-private-meth-
|
||||||
|
name: class declaration private method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
9.4.4 Arguments Exotic Objects
|
||||||
|
|
||||||
|
Most ECMAScript functions make an arguments object available to their code. Depending upon the
|
||||||
|
characteristics of the function definition, its arguments object is either an ordinary object
|
||||||
|
or an arguments exotic object.
|
||||||
|
features: [class, class, class-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
#method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new C().method(/*{ args }*/);
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
path: language/expressions/class/async-gen-meth-static-
|
path: language/arguments-object/cls-expr-async-gen-meth-static-
|
||||||
name: static class expression async generator method
|
name: static class expression async generator method
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
info: |
|
info: |
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
path: language/expressions/class/async-gen-meth-
|
path: language/arguments-object/cls-expr-async-gen-meth-
|
||||||
name: class expression async generator method
|
name: class expression async generator method
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
info: |
|
info: |
|
||||||
|
@ -0,0 +1,58 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-expr-async-private-gen-meth-static-
|
||||||
|
name: static class expression async private generator method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
ClassExpression : class BindingIdentifieropt ClassTail
|
||||||
|
|
||||||
|
1. If BindingIdentifieropt is not present, let className be undefined.
|
||||||
|
2. Else, let className be StringValue of BindingIdentifier.
|
||||||
|
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
||||||
|
with argument className.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||||
|
|
||||||
|
21. For each ClassElement m in order from methods
|
||||||
|
a. If IsStatic of m is false, then
|
||||||
|
b. Else,
|
||||||
|
Let status be the result of performing PropertyDefinitionEvaluation
|
||||||
|
for m with arguments F and false.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
AsyncGeneratorMethod :
|
||||||
|
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||||
|
{ AsyncGeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||||
|
Otherwise let strict be false.
|
||||||
|
4. Let scope be the running execution context's LexicalEnvironment.
|
||||||
|
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||||
|
AsyncGeneratorBody, scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
features: [async-iteration, class, class-static-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
static async * #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ args }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,59 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-expr-async-private-gen-meth-
|
||||||
|
name: class expression async private generator method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
ClassExpression : class BindingIdentifieropt ClassTail
|
||||||
|
|
||||||
|
1. If BindingIdentifieropt is not present, let className be undefined.
|
||||||
|
2. Else, let className be StringValue of BindingIdentifier.
|
||||||
|
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
||||||
|
with argument className.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||||
|
|
||||||
|
21. For each ClassElement m in order from methods
|
||||||
|
a. If IsStatic of m is false, then
|
||||||
|
i. Let status be the result of performing
|
||||||
|
PropertyDefinitionEvaluation for m with arguments proto and
|
||||||
|
false.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
AsyncGeneratorMethod :
|
||||||
|
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||||
|
{ AsyncGeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||||
|
Otherwise let strict be false.
|
||||||
|
4. Let scope be the running execution context's LexicalEnvironment.
|
||||||
|
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||||
|
AsyncGeneratorBody, scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
features: [async-iteration, class, class-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(/*{ args }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
|
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-expr-private-gen-meth-static-
|
||||||
|
name: static class expression private generator method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
9.4.4 Arguments Exotic Objects
|
||||||
|
|
||||||
|
Most ECMAScript functions make an arguments object available to their code. Depending upon the
|
||||||
|
characteristics of the function definition, its arguments object is either an ordinary object
|
||||||
|
or an arguments exotic object.
|
||||||
|
features: [generators, class, class-static-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
static * #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ args }*/).next();
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
31
src/arguments/default/cls-expr-private-gen-meth.template
Normal file
31
src/arguments/default/cls-expr-private-gen-meth.template
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-expr-private-gen-meth-
|
||||||
|
name: class expression private generator method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
9.4.4 Arguments Exotic Objects
|
||||||
|
|
||||||
|
Most ECMAScript functions make an arguments object available to their code. Depending upon the
|
||||||
|
characteristics of the function definition, its arguments object is either an ordinary object
|
||||||
|
or an arguments exotic object.
|
||||||
|
features: [generators, class, class-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
* #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(/*{ args }*/).next();
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
31
src/arguments/default/cls-expr-private-meth-static.template
Normal file
31
src/arguments/default/cls-expr-private-meth-static.template
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-expr-private-meth-static-
|
||||||
|
name: static class expression private method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
9.4.4 Arguments Exotic Objects
|
||||||
|
|
||||||
|
Most ECMAScript functions make an arguments object available to their code. Depending upon the
|
||||||
|
characteristics of the function definition, its arguments object is either an ordinary object
|
||||||
|
or an arguments exotic object.
|
||||||
|
features: [class, class-static-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
static #method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ args }*/);
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
31
src/arguments/default/cls-expr-private-meth.template
Normal file
31
src/arguments/default/cls-expr-private-meth.template
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/arguments-object/cls-expr-private-meth-
|
||||||
|
name: class expression private method
|
||||||
|
esid: sec-argument-lists-runtime-semantics-argumentlistevaluation
|
||||||
|
info: |
|
||||||
|
9.4.4 Arguments Exotic Objects
|
||||||
|
|
||||||
|
Most ECMAScript functions make an arguments object available to their code. Depending upon the
|
||||||
|
characteristics of the function definition, its arguments object is either an ordinary object
|
||||||
|
or an arguments exotic object.
|
||||||
|
features: [class, class-methods-private]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
#method() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(/*{ args }*/);
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
Loading…
x
Reference in New Issue
Block a user