mirror of https://github.com/tc39/test262.git
Fix current generator templates
This commit is contained in:
parent
42d993c45a
commit
76001a503f
|
@ -0,0 +1,33 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/class/gen-method-
|
||||
name: Geenerator method as a ClassDeclaration element
|
||||
esid: prod-GeneratorMethod
|
||||
info: |
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
GeneratorMethod
|
||||
|
||||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorMethod :
|
||||
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class C { *gen() {
|
||||
callCount += 1;
|
||||
/*{ body }*/
|
||||
}}
|
||||
|
||||
var gen = C.prototype.gen;
|
||||
|
||||
var iter = gen();
|
||||
|
||||
/*{ assertions }*/
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/class/gen-method-static-
|
||||
name: Static generator method as a ClassDeclaration element
|
||||
esid: prod-GeneratorMethod
|
||||
info: |
|
||||
ClassElement :
|
||||
static MethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
GeneratorMethod
|
||||
|
||||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorMethod :
|
||||
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class C {static *gen() {
|
||||
callCount += 1;
|
||||
/*{ body }*/
|
||||
}}
|
||||
|
||||
var gen = C.gen;
|
||||
|
||||
var iter = gen();
|
||||
|
||||
/*{ assertions }*/
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -2,24 +2,24 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/class/gen-method-
|
||||
name: Generator method as a ClassElement
|
||||
name: Generator method as a ClassExpression element
|
||||
esid: prod-GeneratorMethod
|
||||
info: |
|
||||
ClassElement[Yield, Await]:
|
||||
MethodDefinition[?Yield, ?Await]
|
||||
ClassElement :
|
||||
MethodDefinition
|
||||
|
||||
MethodDefinition[Yield, Await]:
|
||||
GeneratorMethod[?Yield, ?Await]
|
||||
MethodDefinition :
|
||||
GeneratorMethod
|
||||
|
||||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorMethod[Yield, Await]:
|
||||
* PropertyName[?Yield, ?Await] ( UniqueFormalParameters[+Yield, ~Await] ) { GeneratorBody }
|
||||
GeneratorMethod :
|
||||
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class C { *gen() {
|
||||
var C = class {*gen() {
|
||||
callCount += 1;
|
||||
/*{ body }*/
|
||||
}}
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/class/gen-method-static-
|
||||
name: Static generator method as a ClassExpression element
|
||||
esid: prod-GeneratorMethod
|
||||
info: |
|
||||
ClassElement :
|
||||
static MethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
GeneratorMethod
|
||||
|
||||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorMethod :
|
||||
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class { static *gen() {
|
||||
callCount += 1;
|
||||
/*{ body }*/
|
||||
}}
|
||||
|
||||
var gen = C.gen;
|
||||
|
||||
var iter = gen();
|
||||
|
||||
/*{ assertions }*/
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -2,13 +2,13 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/generators/
|
||||
name: Generator function declaration
|
||||
name: Generator Function declaration
|
||||
esid: prod-GeneratorDeclaration
|
||||
info: |
|
||||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorDeclaration[Yield, Await, Default]:
|
||||
function * BindingIdentifier[?Yield, ?Await] ( FormalParameters[+Yield, ~Await] ) { GeneratorBody }
|
||||
GeneratorDeclaration :
|
||||
function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/generators/named-
|
||||
name: Named generator expression
|
||||
esid: prod-GeneratorExpression
|
||||
info: |
|
||||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorExpression:
|
||||
function * BindingIdentifier opt ( FormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var gen = function *g() {
|
||||
callCount += 1;
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
var iter = gen();
|
||||
|
||||
/*{ assertions }*/
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -2,13 +2,13 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/generators/
|
||||
name: Generator expression
|
||||
name: Unnamed generator expression
|
||||
esid: prod-GeneratorExpression
|
||||
info: |
|
||||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorExpression:
|
||||
function * BindingIdentifier[+Yield, ~Await]opt ( FormalParameters[+Yield, ~Await] ) { GeneratorBody }
|
||||
function * BindingIdentifier opt ( FormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/object/method-definition/generator-
|
||||
path: language/expressions/object/method-definition/gen-
|
||||
name: Generator method
|
||||
esid: prod-GeneratorMethod
|
||||
info: |
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/generators/named-
|
||||
name: Generator named expression - valid for non-strict only cases
|
||||
esid: prod-GeneratorExpression
|
||||
info: |
|
||||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorExpression:
|
||||
function * BindingIdentifier opt ( FormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var gen = function *g() {
|
||||
callCount += 1;
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
var iter = gen();
|
||||
|
||||
/*{ assertions }*/
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -8,7 +8,7 @@ info: |
|
|||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorExpression:
|
||||
function * BindingIdentifier[+Yield, ~Await]opt ( FormalParameters[+Yield, ~Await] ) { GeneratorBody }
|
||||
function * BindingIdentifier opt ( FormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/object/method-definition/generator-
|
||||
path: language/expressions/object/method-definition/gen-
|
||||
name: Generator method - valid for non-strict only cases
|
||||
esid: prod-GeneratorMethod
|
||||
info: |
|
||||
14.4 Generator Function Definitions
|
||||
|
||||
GeneratorMethod[Yield, Await]:
|
||||
* PropertyName[?Yield, ?Await] ( UniqueFormalParameters[+Yield, ~Await] ) { GeneratorBody }
|
||||
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
Loading…
Reference in New Issue