mirror of
https://github.com/tc39/test262.git
synced 2025-07-14 17:44:39 +02:00
Merge pull request #993 from leobalter/function-name
Update templates for function forms
This commit is contained in:
commit
a04ad1fcb5
29
src/arguments/default/async-gen-func-decl.template
Normal file
29
src/arguments/default/async-gen-func-decl.template
Normal file
@ -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/
|
||||||
|
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() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ref(/*{ args }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
30
src/arguments/default/async-gen-func-expr.template
Normal file
30
src/arguments/default/async-gen-func-expr.template
Normal file
@ -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/
|
||||||
|
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*() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
ref(/*{ args }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
37
src/arguments/default/async-gen-meth.template
Normal file
37
src/arguments/default/async-gen-meth.template
Normal file
@ -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/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() {
|
||||||
|
/*{ 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);
|
30
src/arguments/default/async-gen-named-func-expr.template
Normal file
30
src/arguments/default/async-gen-named-func-expr.template
Normal file
@ -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/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() {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
ref(/*{ args }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -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/params-async-gen-meth-static-
|
path: language/statements/class/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: |
|
||||||
@ -42,7 +42,7 @@ features: [async-iteration]
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
class C {
|
class C {
|
||||||
static async *method(/*{ params }*/) {
|
static async *method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
@ -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/params-async-gen-meth-
|
path: language/statements/class/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: |
|
||||||
@ -41,7 +41,7 @@ features: [async-iteration]
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
class C {
|
class C {
|
||||||
async *method(/*{ params }*/) {
|
async *method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
class C {
|
class C {
|
||||||
static *method(/*{ params }*/) {
|
static *method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
class C {
|
class C {
|
||||||
*method(/*{ params }*/) {
|
*method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
class C {
|
class C {
|
||||||
static method(/*{ params }*/) {
|
static method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
class C {
|
class C {
|
||||||
method(/*{ params }*/) {
|
method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -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/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() {
|
||||||
|
/*{ 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);
|
58
src/arguments/default/cls-expr-async-gen-meth.template
Normal file
58
src/arguments/default/cls-expr-async-gen-meth.template
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
// 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/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() {
|
||||||
|
/*{ 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);
|
||||||
|
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
var C = class {
|
var C = class {
|
||||||
static *method(/*{ params }*/) {
|
static *method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
var C = class {
|
var C = class {
|
||||||
*method(/*{ params }*/) {
|
*method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
var C = class {
|
var C = class {
|
||||||
static method(/*{ params }*/) {
|
static method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
var C = class {
|
var C = class {
|
||||||
method(/*{ params }*/) {
|
method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
// Stores a reference `ref` for case evaluation
|
// Stores a reference `ref` for case evaluation
|
||||||
function ref(/*{ params }*/) {
|
function ref() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ info: |
|
|||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
// Stores a reference `ref` for case evaluation
|
// Stores a reference `ref` for case evaluation
|
||||||
var ref;
|
var ref;
|
||||||
ref = function(/*{ params }*/) {
|
ref = function() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
// Stores a reference `ref` for case evaluation
|
// Stores a reference `ref` for case evaluation
|
||||||
function* ref(/*{ params }*/) {
|
function* ref() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ info: |
|
|||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
// Stores a reference `ref` for case evaluation
|
// Stores a reference `ref` for case evaluation
|
||||||
var ref;
|
var ref;
|
||||||
ref = function*(/*{ params }*/) {
|
ref = function*() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
var obj = {
|
var obj = {
|
||||||
*method(/*{ params }*/) {
|
*method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ info: |
|
|||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
var obj = {
|
var obj = {
|
||||||
method(/*{ params }*/) {
|
method() {
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
callCount = callCount + 1;
|
callCount = callCount + 1;
|
||||||
}
|
}
|
||||||
|
@ -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/arrow-function/params-
|
path: language/expressions/arrow-function/
|
||||||
name: arrow function expression
|
name: arrow function expression
|
||||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||||
info: |
|
info: |
|
41
src/function-forms/default/async-arrow-function.template
Normal file
41
src/function-forms/default/async-arrow-function.template
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-arrow-function/
|
||||||
|
name: async arrow function expression
|
||||||
|
esid: sec-async-arrow-function-definitions
|
||||||
|
info: |
|
||||||
|
14.7 Async Arrow Function Definitions
|
||||||
|
|
||||||
|
AsyncArrowFunction :
|
||||||
|
...
|
||||||
|
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
|
||||||
|
|
||||||
|
AsyncConciseBody :
|
||||||
|
{ AsyncFunctionBody }
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
Supplemental Syntax
|
||||||
|
|
||||||
|
When processing an instance of the production AsyncArrowFunction :
|
||||||
|
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody the interpretation of
|
||||||
|
CoverCallExpressionAndAsyncArrowHead is refined using the following grammar:
|
||||||
|
|
||||||
|
AsyncArrowHead :
|
||||||
|
async ArrowFormalParameters
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
|
||||||
|
// Stores a reference `ref` for case evaluation
|
||||||
|
var ref = async (/*{ params }*/) => {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
ref(/*{ args }*/).then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'async arrow function invoked exactly once')
|
||||||
|
}).then($DONE, $DONE);
|
26
src/function-forms/default/async-func-decl.template
Normal file
26
src/function-forms/default/async-func-decl.template
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/statements/async-function/
|
||||||
|
name: async function declaration
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncFunctionDeclaration :
|
||||||
|
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
|
||||||
|
// Stores a reference `ref` for case evaluation
|
||||||
|
async function ref(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ref(/*{ args }*/).then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
27
src/function-forms/default/async-func-expr-named.template
Normal file
27
src/function-forms/default/async-func-expr-named.template
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-function/named-
|
||||||
|
name: async function named expression
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncFunctionExpression :
|
||||||
|
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
|
||||||
|
// Stores a reference `ref` for case evaluation
|
||||||
|
var ref;
|
||||||
|
ref = async function ref(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
ref(/*{ args }*/).then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
27
src/function-forms/default/async-func-expr-nameless.template
Normal file
27
src/function-forms/default/async-func-expr-nameless.template
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-function/nameless-
|
||||||
|
name: async function nameless expression
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncFunctionExpression :
|
||||||
|
async function ( FormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
|
||||||
|
// Stores a reference `ref` for case evaluation
|
||||||
|
var ref;
|
||||||
|
ref = async function(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
ref(/*{ args }*/).then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -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/params-
|
path: language/statements/async-generator/
|
||||||
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/params-
|
path: language/expressions/async-generator/
|
||||||
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/params-async-gen-meth-
|
path: language/expressions/object/method-definition/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/params-named-
|
path: language/expressions/async-generator/named-
|
||||||
name: async generator named function expression
|
name: async generator named function expression
|
||||||
esid: sec-asyncgenerator-definitions-evaluation
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
info: |
|
info: |
|
29
src/function-forms/default/async-meth.template
Normal file
29
src/function-forms/default/async-meth.template
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/object/method-definition/async-meth-
|
||||||
|
name: async method
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncMethod :
|
||||||
|
async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
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 }*/).then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'async method 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/async-gen-meth-static-
|
||||||
|
name: static class declaration async 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);
|
55
src/function-forms/default/cls-decl-async-gen-meth.template
Normal file
55
src/function-forms/default/cls-decl-async-gen-meth.template
Normal file
@ -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/async-gen-meth-
|
||||||
|
name: class declaration async generator 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,53 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/statements/class/async-meth-static-
|
||||||
|
name: static class declaration async 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
|
||||||
|
|
||||||
|
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
||||||
|
let strict be false.
|
||||||
|
4. Let scope be the LexicalEnvironment of the running execution context.
|
||||||
|
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
||||||
|
scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
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 }*/).then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
53
src/function-forms/default/cls-decl-async-meth.template
Normal file
53
src/function-forms/default/cls-decl-async-meth.template
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/statements/class/async-meth-
|
||||||
|
name: class declaration async 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
|
||||||
|
|
||||||
|
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
||||||
|
let strict be false.
|
||||||
|
4. Let scope be the LexicalEnvironment of the running execution context.
|
||||||
|
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
||||||
|
scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
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 }*/).then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -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/params-gen-meth-static-
|
path: language/statements/class/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/params-gen-meth-
|
path: language/statements/class/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: |
|
@ -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/params-meth-static-
|
path: language/statements/class/meth-static-
|
||||||
name: static class expression method
|
name: static class expression 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/params-meth-
|
path: language/statements/class/meth-
|
||||||
name: class expression method
|
name: class expression 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/expressions/class/params-async-gen-meth-static-
|
path: language/expressions/class/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: |
|
@ -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/class/params-async-gen-meth-
|
path: language/expressions/class/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,53 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/expressions/class/async-meth-static-
|
||||||
|
name: static class expression async 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
|
||||||
|
|
||||||
|
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
||||||
|
let strict be false.
|
||||||
|
4. Let scope be the LexicalEnvironment of the running execution context.
|
||||||
|
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
||||||
|
scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
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 }*/).then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
53
src/function-forms/default/cls-expr-async-meth.template
Normal file
53
src/function-forms/default/cls-expr-async-meth.template
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/expressions/class/async-meth-
|
||||||
|
name: class expression async 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
|
||||||
|
|
||||||
|
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
||||||
|
let strict be false.
|
||||||
|
4. Let scope be the LexicalEnvironment of the running execution context.
|
||||||
|
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
||||||
|
scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
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 }*/).then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -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/class/params-gen-meth-static-
|
path: language/expressions/class/gen-meth-static-
|
||||||
name: static class expression generator method
|
name: static class expression generator method
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
esid: sec-class-definitions-runtime-semantics-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/class/params-gen-meth-
|
path: language/expressions/class/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: |
|
@ -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/class/params-meth-static-
|
path: language/expressions/class/meth-static-
|
||||||
name: static class expression method
|
name: static class expression method
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
esid: sec-class-definitions-runtime-semantics-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/class/params-meth-
|
path: language/expressions/class/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: |
|
@ -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/function/params-
|
path: language/statements/function/
|
||||||
name: function declaration
|
name: function declaration
|
||||||
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||||
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/function/params-
|
path: language/expressions/function/
|
||||||
name: function expression
|
name: function expression
|
||||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
esid: sec-function-definitions-runtime-semantics-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/statements/generators/params-
|
path: language/statements/generators/
|
||||||
name: generator function declaration
|
name: generator function declaration
|
||||||
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||||
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/generators/params-
|
path: language/expressions/generators/
|
||||||
name: generator function expression
|
name: generator function expression
|
||||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
esid: sec-generator-function-definitions-runtime-semantics-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/params-gen-meth-
|
path: language/expressions/object/method-definition/gen-meth-
|
||||||
name: generator method
|
name: generator method
|
||||||
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
||||||
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/params-meth-
|
path: language/expressions/object/method-definition/meth-
|
||||||
name: method
|
name: method
|
||||||
esid: sec-runtime-semantics-definemethod
|
esid: sec-runtime-semantics-definemethod
|
||||||
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/arrow-function/params-
|
path: language/expressions/arrow-function/
|
||||||
name: arrow function expression
|
name: arrow function expression
|
||||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||||
info: |
|
info: |
|
45
src/function-forms/error/async-arrow-function.template
Normal file
45
src/function-forms/error/async-arrow-function.template
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-arrow-function/
|
||||||
|
name: async arrow function expression
|
||||||
|
esid: sec-async-arrow-function-definitions
|
||||||
|
info: |
|
||||||
|
14.7 Async Arrow Function Definitions
|
||||||
|
|
||||||
|
AsyncArrowFunction :
|
||||||
|
...
|
||||||
|
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
|
||||||
|
|
||||||
|
AsyncConciseBody :
|
||||||
|
{ AsyncFunctionBody }
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
Supplemental Syntax
|
||||||
|
|
||||||
|
When processing an instance of the production AsyncArrowFunction :
|
||||||
|
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody the interpretation of
|
||||||
|
CoverCallExpressionAndAsyncArrowHead is refined using the following grammar:
|
||||||
|
|
||||||
|
AsyncArrowHead :
|
||||||
|
async ArrowFormalParameters
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f;
|
||||||
|
f = async (/*{ params }*/) => {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
f(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
29
src/function-forms/error/async-func-decl.template
Normal file
29
src/function-forms/error/async-func-decl.template
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/statements/async-function/
|
||||||
|
name: async function declaration
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncFunctionDeclaration :
|
||||||
|
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
async function f(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
f(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
29
src/function-forms/error/async-func-expr-named.template
Normal file
29
src/function-forms/error/async-func-expr-named.template
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-function/named-
|
||||||
|
name: async function named expression
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncFunctionExpression :
|
||||||
|
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f = async function f(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
f(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
29
src/function-forms/error/async-func-expr-nameless.template
Normal file
29
src/function-forms/error/async-func-expr-nameless.template
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-function/nameless-
|
||||||
|
name: async function nameless expression
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncFunctionExpression :
|
||||||
|
async function ( FormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f = async function(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
f(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
@ -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/params-
|
path: language/statements/async-generator/
|
||||||
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/params-
|
path: language/expressions/async-generator/
|
||||||
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/params-async-gen-meth-
|
path: language/expressions/object/method-definition/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/params-named-
|
path: language/expressions/async-generator/named-
|
||||||
name: async generator named function expression
|
name: async generator named function expression
|
||||||
esid: sec-asyncgenerator-definitions-evaluation
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
info: |
|
info: |
|
32
src/function-forms/error/async-meth.template
Normal file
32
src/function-forms/error/async-meth.template
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/object/method-definition/async-meth-
|
||||||
|
name: async method
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncMethod :
|
||||||
|
async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
|
||||||
|
var obj = {
|
||||||
|
async method(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.method(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
@ -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/params-async-gen-meth-static-
|
path: language/statements/class/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/params-async-gen-meth-
|
path: language/statements/class/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: |
|
55
src/function-forms/error/cls-decl-async-meth-static.template
Normal file
55
src/function-forms/error/cls-decl-async-meth-static.template
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/statements/class/async-meth-static-
|
||||||
|
name: static class declaration async 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
|
||||||
|
|
||||||
|
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
||||||
|
let strict be false.
|
||||||
|
4. Let scope be the LexicalEnvironment of the running execution context.
|
||||||
|
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
||||||
|
scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static async method(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
C.method(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
55
src/function-forms/error/cls-decl-async-meth.template
Normal file
55
src/function-forms/error/cls-decl-async-meth.template
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/statements/class/async-meth-
|
||||||
|
name: class declaration async 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
|
||||||
|
|
||||||
|
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
||||||
|
let strict be false.
|
||||||
|
4. Let scope be the LexicalEnvironment of the running execution context.
|
||||||
|
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
||||||
|
scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
async method(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
C.prototype.method(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
@ -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/params-gen-meth-static-
|
path: language/statements/class/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/params-gen-meth-
|
path: language/statements/class/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: |
|
@ -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/params-meth-static-
|
path: language/statements/class/meth-static-
|
||||||
name: static class expression method
|
name: static class expression 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/params-meth-
|
path: language/statements/class/meth-
|
||||||
name: class expression method
|
name: class expression 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/expressions/class/params-async-gen-meth-static-
|
path: language/expressions/class/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: |
|
@ -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/class/params-async-gen-meth-
|
path: language/expressions/class/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: |
|
57
src/function-forms/error/cls-expr-async-meth-static.template
Normal file
57
src/function-forms/error/cls-expr-async-meth-static.template
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/class/async-meth-static-
|
||||||
|
name: static class expression async 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
|
||||||
|
|
||||||
|
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
||||||
|
let strict be false.
|
||||||
|
4. Let scope be the LexicalEnvironment of the running execution context.
|
||||||
|
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
||||||
|
scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
|
||||||
|
var C = class {
|
||||||
|
static async method(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
56
src/function-forms/error/cls-expr-async-meth.template
Normal file
56
src/function-forms/error/cls-expr-async-meth.template
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/class/async-meth-
|
||||||
|
name: class expression async 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
|
||||||
|
|
||||||
|
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
||||||
|
let strict be false.
|
||||||
|
4. Let scope be the LexicalEnvironment of the running execution context.
|
||||||
|
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
||||||
|
scope, strict).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async method(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.prototype.method(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
@ -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/class/params-gen-meth-static-
|
path: language/expressions/class/gen-meth-static-
|
||||||
name: static class expression generator method
|
name: static class expression generator method
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
esid: sec-class-definitions-runtime-semantics-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/class/params-gen-meth-
|
path: language/expressions/class/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: |
|
@ -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/class/params-meth-static-
|
path: language/expressions/class/meth-static-
|
||||||
name: static class expression method
|
name: static class expression method
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
esid: sec-class-definitions-runtime-semantics-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/class/params-meth-
|
path: language/expressions/class/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: |
|
@ -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/function/params-
|
path: language/statements/function/
|
||||||
name: function declaration
|
name: function declaration
|
||||||
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||||
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/function/params-
|
path: language/expressions/function/
|
||||||
name: function expression
|
name: function expression
|
||||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
esid: sec-function-definitions-runtime-semantics-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/statements/generators/params-
|
path: language/statements/generators/
|
||||||
name: generator function declaration
|
name: generator function declaration
|
||||||
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||||
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/generators/params-
|
path: language/expressions/generators/
|
||||||
name: generator function expression
|
name: generator function expression
|
||||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
esid: sec-generator-function-definitions-runtime-semantics-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/params-gen-meth-
|
path: language/expressions/object/method-definition/gen-meth-
|
||||||
name: generator method
|
name: generator method
|
||||||
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
||||||
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/params-meth-
|
path: language/expressions/object/method-definition/meth-
|
||||||
name: method
|
name: method
|
||||||
esid: sec-runtime-semantics-definemethod
|
esid: sec-runtime-semantics-definemethod
|
||||||
info: |
|
info: |
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user