mirror of https://github.com/tc39/test262.git
Add asyng-gen templates for params in the test gen tool
This commit is contained in:
parent
3f89bcb5cf
commit
c6191216c5
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/statements/async-generator/params-
|
||||
name: async generator function declaration
|
||||
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
||||
info: |
|
||||
AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
|
||||
scope, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
// Stores a reference `ref` for case evaluation
|
||||
async function* ref(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
||||
ref(/*{ args }*/).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/expressions/async-generator/params-
|
||||
name: async generator function expression
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
// Stores a reference `ref` for case evaluation
|
||||
var ref;
|
||||
ref = async function*(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
ref(/*{ args }*/).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/object/method-definition/params-async-gen-meth-
|
||||
name: async generator method
|
||||
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
||||
info: |
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
var obj = {
|
||||
async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
// Stores a reference `ref` for case evaluation
|
||||
var ref = obj.method;
|
||||
|
||||
ref(/*{ args }*/).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'generator method invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/expressions/async-generator/params-named-
|
||||
name: async generator named function expression
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
// Stores a reference `ref` for case evaluation
|
||||
var ref;
|
||||
ref = async function* g(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
ref(/*{ args }*/).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,56 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/statements/class/params-async-gen-meth-static-
|
||||
name: static class expression generator method
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
||||
ClassDeclaration : class BindingIdentifier ClassTail
|
||||
|
||||
1. Let className be StringValue of BindingIdentifier.
|
||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
||||
argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
b. Else,
|
||||
Let status be the result of performing PropertyDefinitionEvaluation for
|
||||
m with arguments F and false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
static async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Stores a reference `ref` for case evaluation
|
||||
var ref = C.method;
|
||||
|
||||
ref(/*{ args }*/).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/class/params-async-gen-meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
ClassDeclaration : class BindingIdentifier ClassTail
|
||||
|
||||
1. Let className be StringValue of BindingIdentifier.
|
||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
||||
argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
i. Let status be the result of performing
|
||||
PropertyDefinitionEvaluation for m with arguments proto and
|
||||
false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Stores a reference `ref` for case evaluation
|
||||
var ref = C.prototype.method;
|
||||
|
||||
ref(/*{ args }*/).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,56 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/class/params-async-gen-meth-static-
|
||||
name: static class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
ClassExpression : class BindingIdentifieropt ClassTail
|
||||
|
||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
||||
2. Else, let className be StringValue of BindingIdentifier.
|
||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
||||
with argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
b. Else,
|
||||
Let status be the result of performing PropertyDefinitionEvaluation
|
||||
for m with arguments F and false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Stores a reference `ref` for case evaluation
|
||||
var ref = C.method;
|
||||
|
||||
ref(/*{ args }*/).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,57 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/class/params-async-gen-meth-
|
||||
name: class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
ClassExpression : class BindingIdentifieropt ClassTail
|
||||
|
||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
||||
2. Else, let className be StringValue of BindingIdentifier.
|
||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
||||
with argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
i. Let status be the result of performing
|
||||
PropertyDefinitionEvaluation for m with arguments proto and
|
||||
false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Stores a reference `ref` for case evaluation
|
||||
var ref = C.prototype.method;
|
||||
|
||||
ref(/*{ args }*/).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/statements/async-generator/params-
|
||||
name: async generator function declaration
|
||||
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
||||
info: |
|
||||
AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
|
||||
scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
async function* f(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
f(/*{ args }*/);
|
||||
});
|
||||
|
||||
assert.sameValue(callCount, 0, 'generator function body not evaluated');
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/expressions/async-generator/params-
|
||||
name: async generator function expression
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
f(/*{ args }*/);
|
||||
});
|
||||
assert.sameValue(callCount, 0, 'generator function body not evaluated');
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/object/method-definition/params-async-gen-meth-
|
||||
name: async generator method
|
||||
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
||||
info: |
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
var obj = {
|
||||
async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
obj.method(/*{ args }*/);
|
||||
});
|
||||
assert.sameValue(callCount, 0, 'generator method body not evaluated');
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/expressions/async-generator/params-named-
|
||||
name: async generator named function expression
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function* g(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
f(/*{ args }*/);
|
||||
});
|
||||
assert.sameValue(callCount, 0, 'generator function body not evaluated');
|
|
@ -0,0 +1,54 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/statements/class/params-async-gen-meth-static-
|
||||
name: static class expression generator method
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
||||
ClassDeclaration : class BindingIdentifier ClassTail
|
||||
|
||||
1. Let className be StringValue of BindingIdentifier.
|
||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
||||
argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
b. Else,
|
||||
Let status be the result of performing PropertyDefinitionEvaluation for
|
||||
m with arguments F and false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
static async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
C.method(/*{ args }*/);
|
||||
});
|
||||
|
||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -0,0 +1,52 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/class/params-async-gen-meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
ClassDeclaration : class BindingIdentifier ClassTail
|
||||
|
||||
1. Let className be StringValue of BindingIdentifier.
|
||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
||||
argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
i. Let status be the result of performing
|
||||
PropertyDefinitionEvaluation for m with arguments proto and
|
||||
false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
C.prototype.method(/*{ args }*/);
|
||||
});
|
||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -0,0 +1,53 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/class/params-async-gen-meth-static-
|
||||
name: static class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
ClassExpression : class BindingIdentifieropt ClassTail
|
||||
|
||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
||||
2. Else, let className be StringValue of BindingIdentifier.
|
||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
||||
with argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
b. Else,
|
||||
Let status be the result of performing PropertyDefinitionEvaluation
|
||||
for m with arguments F and false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
C.method(/*{ args }*/);
|
||||
});
|
||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -0,0 +1,74 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/class/params-async-gen-meth-
|
||||
name: class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
ClassExpression : class BindingIdentifieropt ClassTail
|
||||
|
||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
||||
2. Else, let className be StringValue of BindingIdentifier.
|
||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
||||
with argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
i. Let status be the result of performing
|
||||
PropertyDefinitionEvaluation for m with arguments proto and
|
||||
false.
|
||||
[...]
|
||||
|
||||
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
GeneratorMethod :
|
||||
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this GeneratorMethod is strict mode code,
|
||||
let strict be true. Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be GeneratorFunctionCreate(Method,
|
||||
StrictFormalParameters, GeneratorBody, scope, strict).
|
||||
|
||||
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||
|
||||
[...]
|
||||
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||
[...]
|
||||
|
||||
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||
|
||||
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||
[...]
|
||||
|
||||
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||
|
||||
[...]
|
||||
23. Let iteratorRecord be Record {[[iterator]]:
|
||||
CreateListIterator(argumentsList), [[done]]: false}.
|
||||
24. If hasDuplicates is true, then
|
||||
[...]
|
||||
25. Else,
|
||||
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||
iteratorRecord and env as arguments.
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
C.prototype.method(/*{ args }*/);
|
||||
});
|
||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/statements/async-generator/params-
|
||||
name: async generator function declaration
|
||||
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
||||
info: |
|
||||
AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
|
||||
scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
async function* f(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/expressions/async-generator/params-
|
||||
name: async generator function expression
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
0, async function*(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
};
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/object/method-definition/params-async-gen-meth-
|
||||
name: async generator method
|
||||
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
||||
info: |
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
0, {
|
||||
async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
}
|
||||
};
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/expressions/async-generator/params-named-
|
||||
name: async generator named function expression
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
flags: [async]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
0, async function* g(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
};
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
path: language/statements/class/params-async-gen-meth-static-
|
||||
name: static class expression generator method
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
||||
ClassDeclaration : class BindingIdentifier ClassTail
|
||||
|
||||
1. Let className be StringValue of BindingIdentifier.
|
||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
||||
argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
b. Else,
|
||||
Let status be the result of performing PropertyDefinitionEvaluation for
|
||||
m with arguments F and false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
class C {
|
||||
static async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/class/params-async-gen-meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
ClassDeclaration : class BindingIdentifier ClassTail
|
||||
|
||||
1. Let className be StringValue of BindingIdentifier.
|
||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
||||
argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
i. Let status be the result of performing
|
||||
PropertyDefinitionEvaluation for m with arguments proto and
|
||||
false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
class C {
|
||||
async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/class/params-async-gen-meth-static-
|
||||
name: static class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
ClassExpression : class BindingIdentifieropt ClassTail
|
||||
|
||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
||||
2. Else, let className be StringValue of BindingIdentifier.
|
||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
||||
with argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
b. Else,
|
||||
Let status be the result of performing PropertyDefinitionEvaluation
|
||||
for m with arguments F and false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
0, class {
|
||||
static async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
}
|
||||
};
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/class/params-async-gen-meth-
|
||||
name: class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
ClassExpression : class BindingIdentifieropt ClassTail
|
||||
|
||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
||||
2. Else, let className be StringValue of BindingIdentifier.
|
||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
||||
with argument className.
|
||||
[...]
|
||||
|
||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
||||
|
||||
21. For each ClassElement m in order from methods
|
||||
a. If IsStatic of m is false, then
|
||||
i. Let status be the result of performing
|
||||
PropertyDefinitionEvaluation for m with arguments proto and
|
||||
false.
|
||||
[...]
|
||||
|
||||
Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||
{ AsyncGeneratorBody }
|
||||
|
||||
1. Let propKey be the result of evaluating PropertyName.
|
||||
2. ReturnIfAbrupt(propKey).
|
||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||
Otherwise let strict be false.
|
||||
4. Let scope be the running execution context's LexicalEnvironment.
|
||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
0, class {
|
||||
async *method(/*{ params }*/) {
|
||||
/*{ body }*/
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue