mirror of https://github.com/tc39/test262.git
Merge pull request #993 from leobalter/function-name
Update templates for function forms
This commit is contained in:
commit
a04ad1fcb5
|
@ -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);
|
|
@ -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);
|
|
@ -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);
|
|
@ -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.
|
||||
|
||||
/*---
|
||||
path: language/statements/class/params-async-gen-meth-static-
|
||||
path: language/statements/class/async-gen-meth-static-
|
||||
name: static class expression generator method
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
||||
|
@ -42,7 +42,7 @@ features: [async-iteration]
|
|||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
static async *method(/*{ params }*/) {
|
||||
static async *method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
// 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-
|
||||
path: language/statements/class/async-gen-meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
|
@ -41,7 +41,7 @@ features: [async-iteration]
|
|||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
async *method(/*{ params }*/) {
|
||||
async *method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
static *method(/*{ params }*/) {
|
||||
static *method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
*method(/*{ params }*/) {
|
||||
*method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
static method(/*{ params }*/) {
|
||||
static method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
class C {
|
||||
method(/*{ params }*/) {
|
||||
method() {
|
||||
/*{ body }*/
|
||||
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);
|
|
@ -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 C = class {
|
||||
static *method(/*{ params }*/) {
|
||||
static *method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
*method(/*{ params }*/) {
|
||||
*method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static method(/*{ params }*/) {
|
||||
static method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
method(/*{ params }*/) {
|
||||
method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
// Stores a reference `ref` for case evaluation
|
||||
function ref(/*{ params }*/) {
|
||||
function ref() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ info: |
|
|||
var callCount = 0;
|
||||
// Stores a reference `ref` for case evaluation
|
||||
var ref;
|
||||
ref = function(/*{ params }*/) {
|
||||
ref = function() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
// Stores a reference `ref` for case evaluation
|
||||
function* ref(/*{ params }*/) {
|
||||
function* ref() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ info: |
|
|||
var callCount = 0;
|
||||
// Stores a reference `ref` for case evaluation
|
||||
var ref;
|
||||
ref = function*(/*{ params }*/) {
|
||||
ref = function*() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
var obj = {
|
||||
*method(/*{ params }*/) {
|
||||
*method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ info: |
|
|||
|
||||
var callCount = 0;
|
||||
var obj = {
|
||||
method(/*{ params }*/) {
|
||||
method() {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// 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/arrow-function/params-
|
||||
path: language/expressions/arrow-function/
|
||||
name: arrow function expression
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -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);
|
|
@ -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);
|
|
@ -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);
|
|
@ -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.
|
||||
|
||||
/*---
|
||||
path: language/statements/async-generator/params-
|
||||
path: language/statements/async-generator/
|
||||
name: async generator function declaration
|
||||
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-
|
||||
path: language/expressions/object/method-definition/async-gen-meth-
|
||||
name: async generator method
|
||||
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
|
@ -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);
|
|
@ -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);
|
|
@ -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.
|
||||
// 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
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-gen-meth-
|
||||
path: language/statements/class/gen-meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-static-
|
||||
path: language/statements/class/meth-static-
|
||||
name: static class expression method
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-
|
||||
path: language/statements/class/meth-
|
||||
name: class expression method
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-
|
||||
path: language/expressions/class/async-gen-meth-static-
|
||||
name: static class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-
|
||||
path: language/expressions/class/async-gen-meth-
|
||||
name: class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
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);
|
|
@ -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.
|
||||
// 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
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-gen-meth-
|
||||
path: language/expressions/class/gen-meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-static-
|
||||
path: language/expressions/class/meth-static-
|
||||
name: static class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-
|
||||
path: language/expressions/class/meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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/function/params-
|
||||
path: language/statements/function/
|
||||
name: function declaration
|
||||
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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/function/params-
|
||||
path: language/expressions/function/
|
||||
name: function expression
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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/generators/params-
|
||||
path: language/statements/generators/
|
||||
name: generator function declaration
|
||||
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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/generators/params-
|
||||
path: language/expressions/generators/
|
||||
name: generator function expression
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-gen-meth-
|
||||
path: language/expressions/object/method-definition/gen-meth-
|
||||
name: generator method
|
||||
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-
|
||||
path: language/expressions/object/method-definition/meth-
|
||||
name: method
|
||||
esid: sec-runtime-semantics-definemethod
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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/arrow-function/params-
|
||||
path: language/expressions/arrow-function/
|
||||
name: arrow function expression
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -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);
|
|
@ -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);
|
|
@ -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);
|
|
@ -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.
|
||||
|
||||
/*---
|
||||
path: language/statements/async-generator/params-
|
||||
path: language/statements/async-generator/
|
||||
name: async generator function declaration
|
||||
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-
|
||||
path: language/expressions/object/method-definition/async-gen-meth-
|
||||
name: async generator method
|
||||
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
|
@ -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.
|
||||
|
||||
/*---
|
||||
path: language/statements/class/params-async-gen-meth-static-
|
||||
path: language/statements/class/async-gen-meth-static-
|
||||
name: static class expression generator method
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-
|
||||
path: language/statements/class/async-gen-meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -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);
|
|
@ -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.
|
||||
// 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
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-gen-meth-
|
||||
path: language/statements/class/gen-meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-static-
|
||||
path: language/statements/class/meth-static-
|
||||
name: static class expression method
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-
|
||||
path: language/statements/class/meth-
|
||||
name: class expression method
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-
|
||||
path: language/expressions/class/async-gen-meth-static-
|
||||
name: static class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-
|
||||
path: language/expressions/class/async-gen-meth-
|
||||
name: class expression async generator method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -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);
|
|
@ -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.
|
||||
// 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
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-gen-meth-
|
||||
path: language/expressions/class/gen-meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-static-
|
||||
path: language/expressions/class/meth-static-
|
||||
name: static class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-
|
||||
path: language/expressions/class/meth-
|
||||
name: class expression method
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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/function/params-
|
||||
path: language/statements/function/
|
||||
name: function declaration
|
||||
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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/function/params-
|
||||
path: language/expressions/function/
|
||||
name: function expression
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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/generators/params-
|
||||
path: language/statements/generators/
|
||||
name: generator function declaration
|
||||
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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/generators/params-
|
||||
path: language/expressions/generators/
|
||||
name: generator function expression
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-gen-meth-
|
||||
path: language/expressions/object/method-definition/gen-meth-
|
||||
name: generator method
|
||||
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
info: |
|
|
@ -1,7 +1,7 @@
|
|||
// 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-meth-
|
||||
path: language/expressions/object/method-definition/meth-
|
||||
name: method
|
||||
esid: sec-runtime-semantics-definemethod
|
||||
info: |
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue