Separate cases

This commit is contained in:
Rick Waldron 2020-09-25 17:13:29 -04:00
parent 9e71e2120a
commit 97e051114a
28 changed files with 363 additions and 58 deletions

View File

@ -0,0 +1,22 @@
// Copyright (C) 2017 André Bargull. 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
esid: prod-AsyncArrowFunction
info: |
Async Arrow Function Definitions
AsyncArrowFunction[In, Yield, Await]:
async [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] => AsyncConciseBody[?In]
CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] => AsyncConciseBody[?In]
AsyncConciseBody[In]:
{ AsyncFunctionBody }
features: [async-functions]
---*/
async (/*{ params }*/) => {
/*{ body }*/
}

View File

@ -0,0 +1,29 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/statements/class/async-method/
name: Async method as a ClassDeclaration element
esid: prod-AsyncMethod
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions]
---*/
class C {
async method(/*{ params }*/) {
/*{ body }*/
}
}
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);

View File

@ -0,0 +1,32 @@
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/statements/class/elements/async-private-method/
name: Async private method as a ClassDeclaration element
esid: prod-AsyncMethod
info: |
ClassElement :
PrivateMethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions, class-methods-private]
---*/
class C {
async #method(/*{ params }*/) {
/*{ body }*/
}
async method(/*{ params }*/) {
return this.#method(/*{ params }*/);
}
}
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);

View File

@ -0,0 +1,28 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/statements/class/async-method-static/
name: Static async method as a ClassDeclaration element
esid: prod-AsyncMethod
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions]
---*/
class C {
static async method(/*{ params }*/) {
/*{ body }*/
}
}
// Stores a reference `asyncFn` for case evaluation
let asyncFn = C.method;

View File

@ -0,0 +1,31 @@
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/statements/class/elements/async-private-method-static/
name: Static async private method as a ClassDeclaration element
esid: prod-AsyncMethod
info: |
ClassElement :
static PrivateMethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions, class-static-methods-private]
---*/
class C {
static async #method(/*{ params }*/) {
/*{ body }*/
}
static async method(/*{ params }*/) {
return this.#method(/*{ params }*/);
}
}
// Stores a reference `asyncFn` for case evaluation
let asyncFn = C.method.bind(C);

View File

@ -0,0 +1,29 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/expressions/class/async-method/
name: Async method as a ClassExpression element
esid: prod-AsyncMethod
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions]
---*/
var C = class {
async method(/*{ params }*/) {
/*{ body }*/
}
};
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);

View File

@ -0,0 +1,32 @@
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/expressions/class/elements/async-private-method/
name: Async private method as a ClassExpression element
esid: prod-AsyncMethod
info: |
ClassElement :
PrivateMethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions, class-methods-private]
---*/
var C = class {
async #method(/*{ params }*/) {
/*{ body }*/
}
async method(/*{ params }*/) {
return this.#method(/*{ params }*/);
}
};
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);

View File

@ -0,0 +1,28 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/expressions/class/async-method-static/
name: Static async method as a ClassExpression element
esid: prod-AsyncMethod
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions]
---*/
var C = class {
static async method(/*{ params }*/) {
/*{ body }*/
}
};
// Stores a reference `asyncFn` for case evaluation
let asyncFn = C.method;

View File

@ -0,0 +1,31 @@
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/expressions/class/elements/async-private-method-static/
name: Static private async method as a ClassExpression element
esid: prod-AsyncMethod
info: |
ClassElement :
static PrivateMethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions, class-static-methods-private]
---*/
var C = class {
static async #method(/*{ params }*/) {
/*{ body }*/
}
static async method(/*{ params }*/) {
return this.#method(/*{ params }*/);
}
}
// Stores a reference `asyncFn` for case evaluation
let asyncFn = C.method.bind(C);

View File

@ -0,0 +1,18 @@
// Copyright (C) 2017 André Bargull. 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: prod-AsyncFunctionDeclaration
info: |
Async Function Definitions
AsyncFunctionDeclaration:
async [no LineTerminator here] function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
features: [async-functions]
---*/
async function asyncFn(/*{ params }*/) {
/*{ body }*/
}

View File

@ -0,0 +1,18 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/expressions/async-function/named-
name: Named async function expression
esid: prod-AsyncFunctionExpression
info: |
Async Function Definitions
AsyncFunctionExpression :
async [no LineTerminator here] function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
features: [async-functions]
---*/
var asyncFn = async function asyncFn(/*{ params }*/) {
/*{ body }*/
};

View File

@ -0,0 +1,18 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/expressions/async-function/
name: Unnamed async function expression
esid: prod-AsyncFunctionExpression
info: |
Async Function Definitions
AsyncFunctionExpression :
async [no LineTerminator here] function ( FormalParameters ) { AsyncFunctionBody }
features: [async-functions]
---*/
var asyncFn = async function (/*{ params }*/) {
/*{ body }*/
};

View File

@ -0,0 +1,22 @@
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/expressions/object/method-definition/async-
name: Async method
esid: prod-AsyncMethod
info: |
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions]
---*/
var obj = {
async method(/*{ params }*/) {
/*{ body }*/
}
};
// Stores a reference `asyncFn` for case evaluation
let asyncFn = obj.method;

View File

@ -6,10 +6,10 @@ esid: sec-async-arrow-function-definitions
desc: > desc: >
Async function returns an async function. Async function returns an async function.
templates: templates:
- syntax/async-class-*.template - evaluation/async-class-*.template
- syntax/async-declaration.template - evaluation/async-declaration.template
- syntax/async-expression-*.template - evaluation/async-expression-*.template
- syntax/async-obj-method.template - evaluation/async-obj-method.template
flags: [async] flags: [async]
---*/ ---*/

View File

@ -6,10 +6,10 @@ esid: sec-async-arrow-function-definitions
desc: > desc: >
Async function returns an async function. Async function returns an async function.
templates: templates:
- syntax/async-class-*.template - evaluation/async-class-*.template
- syntax/async-declaration.template - evaluation/async-declaration.template
- syntax/async-expression-*.template - evaluation/async-expression-*.template
- syntax/async-obj-method.template - evaluation/async-obj-method.template
flags: [async] flags: [async]
---*/ ---*/

View File

@ -6,10 +6,10 @@ esid: sec-async-arrow-function-definitions
desc: > desc: >
Async function returns an async function. Async function returns an async function.
templates: templates:
- syntax/async-class-*.template - evaluation/async-class-*.template
- syntax/async-declaration.template - evaluation/async-declaration.template
- syntax/async-expression-*.template - evaluation/async-expression-*.template
- syntax/async-obj-method.template - evaluation/async-obj-method.template
flags: [async] flags: [async]
---*/ ---*/

View File

@ -6,10 +6,10 @@ esid: sec-async-arrow-function-definitions
desc: > desc: >
Async function returns an async function. Async function returns an async function.
templates: templates:
- syntax/async-class-*.template - evaluation/async-class-*.template
- syntax/async-declaration.template - evaluation/async-declaration.template
- syntax/async-expression-*.template - evaluation/async-expression-*.template
- syntax/async-obj-method.template - evaluation/async-obj-method.template
flags: [async] flags: [async]
---*/ ---*/

View File

@ -6,10 +6,10 @@ esid: sec-async-arrow-function-definitions
desc: > desc: >
Async function returns an async function. Async function returns an async function.
templates: templates:
- syntax/async-class-*.template - evaluation/async-class-*.template
- syntax/async-declaration.template - evaluation/async-declaration.template
- syntax/async-expression-*.template - evaluation/async-expression-*.template
- syntax/async-obj-method.template - evaluation/async-obj-method.template
flags: [async] flags: [async]
---*/ ---*/

View File

@ -6,10 +6,10 @@ esid: sec-async-arrow-function-definitions
desc: > desc: >
Async function returns an async function. Async function returns an async function.
templates: templates:
- syntax/async-class-*.template - evaluation/async-class-*.template
- syntax/async-declaration.template - evaluation/async-declaration.template
- syntax/async-expression-*.template - evaluation/async-expression-*.template
- syntax/async-obj-method.template - evaluation/async-obj-method.template
flags: [async] flags: [async]
---*/ ---*/

View File

@ -24,6 +24,3 @@ class C {
/*{ body }*/ /*{ body }*/
} }
} }
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);

View File

@ -23,10 +23,4 @@ class C {
async #method(/*{ params }*/) { async #method(/*{ params }*/) {
/*{ body }*/ /*{ body }*/
} }
async method(/*{ params }*/) {
return this.#method(/*{ params }*/);
} }
}
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);

View File

@ -24,6 +24,4 @@ class C {
/*{ body }*/ /*{ body }*/
} }
} }
// Stores a reference `asyncFn` for case evaluation
let asyncFn = C.method;

View File

@ -23,10 +23,6 @@ class C {
static async #method(/*{ params }*/) { static async #method(/*{ params }*/) {
/*{ body }*/ /*{ body }*/
} }
static async method(/*{ params }*/) {
return this.#method(/*{ params }*/);
} }
}
// Stores a reference `asyncFn` for case evaluation
let asyncFn = C.method.bind(C);

View File

@ -24,7 +24,4 @@ var C = class {
/*{ body }*/ /*{ body }*/
} }
}; };
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);

View File

@ -23,10 +23,4 @@ var C = class {
async #method(/*{ params }*/) { async #method(/*{ params }*/) {
/*{ body }*/ /*{ body }*/
} }
async method(/*{ params }*/) {
return this.#method(/*{ params }*/);
}
}; };
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);

View File

@ -24,5 +24,3 @@ var C = class {
/*{ body }*/ /*{ body }*/
} }
}; };
// Stores a reference `asyncFn` for case evaluation
let asyncFn = C.method;

View File

@ -23,9 +23,4 @@ var C = class {
static async #method(/*{ params }*/) { static async #method(/*{ params }*/) {
/*{ body }*/ /*{ body }*/
} }
static async method(/*{ params }*/) {
return this.#method(/*{ params }*/);
} }
}
// Stores a reference `asyncFn` for case evaluation
let asyncFn = C.method.bind(C);

View File

@ -18,5 +18,3 @@ var obj = {
/*{ body }*/ /*{ body }*/
} }
}; };
// Stores a reference `asyncFn` for case evaluation
let asyncFn = obj.method;