mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
Update tests for top-level await
This commit is contained in:
parent
32bb36f5e4
commit
69bf8fb0f8
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression ArrayLiteral
|
AwaitExpression ArrayLiteral
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
this
|
this
|
||||||
IdentifierReference[?Yield, ?Await]
|
IdentifierReference[?Yield, ?Await]
|
||||||
@ -33,9 +19,8 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await [];
|
//- expr
|
||||||
|
await []
|
@ -2,25 +2,13 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression StringLiteral
|
AwaitExpression StringLiteral
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
ExpressionStatement[Yield, Await]:
|
ExpressionStatement[Yield, Await]:
|
||||||
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
Expression[+In, ?Yield, ?Await];
|
Expression[+In, ?Yield, ?Await];
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
@ -37,9 +25,8 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await function() {};
|
//- expr
|
||||||
|
await function() {}
|
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression IdentifierReference
|
AwaitExpression IdentifierReference
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
this
|
this
|
||||||
IdentifierReference[?Yield, ?Await]
|
IdentifierReference[?Yield, ?Await]
|
||||||
@ -33,11 +19,10 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
//- setup
|
||||||
var foo = 1;
|
var foo = 1;
|
||||||
|
//- expr
|
||||||
await foo;
|
await foo
|
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression NumberLiteral
|
AwaitExpression NumberLiteral
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
this
|
this
|
||||||
IdentifierReference[?Yield, ?Await]
|
IdentifierReference[?Yield, ?Await]
|
||||||
@ -33,9 +19,8 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await 1;
|
//- expr
|
||||||
|
await 1
|
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression StringLiteral
|
AwaitExpression StringLiteral
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
this
|
this
|
||||||
IdentifierReference[?Yield, ?Await]
|
IdentifierReference[?Yield, ?Await]
|
||||||
@ -33,9 +19,8 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await '';
|
//- expr
|
||||||
|
await ''
|
@ -2,15 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
Nested AwaitExpressions
|
Nested AwaitExpressions
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
TryStatement[Yield, Await, Return]:
|
TryStatement[Yield, Await, Return]:
|
||||||
try Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return]
|
try Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return]
|
||||||
try Block[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return]
|
try Block[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return]
|
||||||
@ -21,15 +15,8 @@ info: |
|
|||||||
ExpressionStatement[Yield, Await]:
|
ExpressionStatement[Yield, Await]:
|
||||||
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
||||||
Expression[+In, ?Yield, ?Await];
|
Expression[+In, ?Yield, ?Await];
|
||||||
|
template: syntax
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
esid: prod-AwaitExpression
|
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await await await await await await await await await await await await await await await 'await';
|
//- expr
|
||||||
|
await await await await await await await await await await await await await await await 'await'
|
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
AwaitExpression new MemberExpression
|
||||||
AwaitExpression ArrayLiteral
|
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
LeftHandSideExpression[Yield, Await]:
|
LeftHandSideExpression[Yield, Await]:
|
||||||
NewExpression[?Yield, ?Await]
|
NewExpression[?Yield, ?Await]
|
||||||
CallExpression[?Yield, ?Await]
|
CallExpression[?Yield, ?Await]
|
||||||
@ -30,9 +16,8 @@ info: |
|
|||||||
MemberExpression[Yield, Await]:
|
MemberExpression[Yield, Await]:
|
||||||
...
|
...
|
||||||
new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]
|
new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await new Promise(function(res, rej) { res(1); });
|
//- expr
|
||||||
|
await new Promise(function(res, rej) { res(1); })
|
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression NullLiteral
|
AwaitExpression NullLiteral
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
this
|
this
|
||||||
IdentifierReference[?Yield, ?Await]
|
IdentifierReference[?Yield, ?Await]
|
||||||
@ -33,9 +19,8 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await null;
|
//- expr
|
||||||
|
await null
|
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression ObjectLiteral
|
AwaitExpression ObjectLiteral
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
this
|
this
|
||||||
IdentifierReference[?Yield, ?Await]
|
IdentifierReference[?Yield, ?Await]
|
||||||
@ -33,12 +19,10 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
// This syntax helps avoiding the code being parsed as a Block
|
// This syntax helps avoiding the code being parsed as a Block
|
||||||
await { function() {} };
|
|
||||||
|
|
||||||
// Yes, it's a MethodDefinition...
|
// Yes, it's a MethodDefinition...
|
||||||
|
//- expr
|
||||||
|
await { function() {} }
|
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression RegularExpressionLiteral
|
AwaitExpression RegularExpressionLiteral
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
this
|
this
|
||||||
IdentifierReference[?Yield, ?Await]
|
IdentifierReference[?Yield, ?Await]
|
||||||
@ -33,9 +19,8 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await /1/;
|
//- expr
|
||||||
|
await /1/
|
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression TemplateLiteral
|
AwaitExpression TemplateLiteral
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
this
|
this
|
||||||
IdentifierReference[?Yield, ?Await]
|
IdentifierReference[?Yield, ?Await]
|
||||||
@ -33,10 +19,9 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await ``;
|
//- expr
|
||||||
|
await ``
|
||||||
|
|
@ -2,23 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
desc: >
|
||||||
Valid syntax for top level await.
|
|
||||||
AwaitExpression this
|
AwaitExpression this
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
|
||||||
[+Await]AwaitExpression[?Yield]
|
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
|
||||||
await UnaryExpression[?Yield, +Await]
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
PrimaryExpression[Yield, Await]:
|
PrimaryExpression[Yield, Await]:
|
||||||
this
|
this
|
||||||
IdentifierReference[?Yield, ?Await]
|
IdentifierReference[?Yield, ?Await]
|
||||||
@ -33,9 +19,8 @@ info: |
|
|||||||
RegularExpressionLiteral
|
RegularExpressionLiteral
|
||||||
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
TemplateLiteral[?Yield, ?Await, ~Tagged]
|
||||||
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
|
||||||
esid: prod-AwaitExpression
|
template: syntax
|
||||||
flags: [module]
|
|
||||||
features: [top-level-await]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
await this;
|
//- expr
|
||||||
|
await this
|
@ -2,37 +2,22 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
path: language/module-code/top-level-await/syntax/block-
|
||||||
Valid syntax for top level await. It propagates to the StatementList of a Block
|
name: Valid syntax for top level await in a block.
|
||||||
|
esid: prod-AwaitExpression
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
ModuleItem:
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
|
|
||||||
StatementListItem[Yield, Await, Return]:
|
|
||||||
Statement[?Yield, ?Await, ?Return]
|
|
||||||
Declaration[?Yield, ?Await]
|
|
||||||
|
|
||||||
Statement[Yield, Await, Return]:
|
|
||||||
BlockStatement[?Yield, ?Await, ?Return]
|
|
||||||
|
|
||||||
BlockStatement[Yield, Await, Return]:
|
|
||||||
Block[?Yield, ?Await, ?Return]
|
|
||||||
|
|
||||||
Block[Yield, Await, Return]:
|
|
||||||
{ StatementList[?Yield, ?Await, ?Return]_opt }
|
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
ExpressionStatement[Yield, Await]:
|
|
||||||
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
|
||||||
Expression[+In, ?Yield, ?Await];
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
UnaryExpression[Yield, Await]
|
||||||
[+Await]AwaitExpression[?Yield]
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
AwaitExpression[Yield]:
|
||||||
await UnaryExpression[?Yield, +Await]
|
await UnaryExpression[?Yield, +Await]
|
||||||
esid: prod-AwaitExpression
|
|
||||||
|
...
|
||||||
flags: [module]
|
flags: [module]
|
||||||
features: [top-level-await]
|
features: [top-level-await]
|
||||||
---*/
|
---*/
|
||||||
@ -54,7 +39,7 @@ features: [top-level-await]
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
await {};
|
/*{ expr }*/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
50
src/top-level-await/syntax/for-await-expr.template
Normal file
50
src/top-level-await/syntax/for-await-expr.template
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/module-code/top-level-await/syntax/for-await-
|
||||||
|
name: Valid syntax for top level await in for await statements.
|
||||||
|
esid: prod-AwaitExpression
|
||||||
|
info: |
|
||||||
|
ModuleItem:
|
||||||
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
IterationStatement[Yield, Await, Return]:
|
||||||
|
[+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return]
|
||||||
|
[+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return]
|
||||||
|
[+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
UnaryExpression[Yield, Await]
|
||||||
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
|
AwaitExpression[Yield]:
|
||||||
|
await UnaryExpression[?Yield, +Await]
|
||||||
|
|
||||||
|
...
|
||||||
|
flags: [module]
|
||||||
|
features: [top-level-await, async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var binding;
|
||||||
|
|
||||||
|
// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return]
|
||||||
|
for await (binding of [/*{ expr }*/]) {
|
||||||
|
/*{ expr }*/;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return]
|
||||||
|
for await (var binding of [/*{ expr }*/]) {
|
||||||
|
/*{ expr }*/;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return]
|
||||||
|
for await (let binding of [/*{ expr }*/]) {
|
||||||
|
/*{ expr }*/;
|
||||||
|
break;
|
||||||
|
}
|
@ -2,9 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
path: language/module-code/top-level-await/syntax/if-block-
|
||||||
Valid syntax for top level await.
|
name: Valid syntax for top level await in an if expression position.
|
||||||
IfStatement ( AwaitExpression BooleanLiteral )
|
esid: prod-AwaitExpression
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
ModuleItem:
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
@ -17,18 +17,17 @@ info: |
|
|||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
ExpressionStatement[Yield, Await]:
|
|
||||||
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
|
||||||
Expression[+In, ?Yield, ?Await];
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
UnaryExpression[Yield, Await]
|
||||||
[+Await]AwaitExpression[?Yield]
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
AwaitExpression[Yield]:
|
||||||
await UnaryExpression[?Yield, +Await]
|
await UnaryExpression[?Yield, +Await]
|
||||||
esid: prod-AwaitExpression
|
|
||||||
|
...
|
||||||
flags: [module]
|
flags: [module]
|
||||||
features: [top-level-await]
|
features: [top-level-await]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
if (await false) {};
|
if (true) {
|
||||||
|
/*{ expr }*/;
|
||||||
|
}
|
31
src/top-level-await/syntax/if-expr.template
Normal file
31
src/top-level-await/syntax/if-expr.template
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/module-code/top-level-await/syntax/if-expr-
|
||||||
|
name: Valid syntax for top level await in an if expression position.
|
||||||
|
esid: prod-AwaitExpression
|
||||||
|
info: |
|
||||||
|
ModuleItem:
|
||||||
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
IfStatement[Yield, Await, Return]:
|
||||||
|
if(Expression[+In, ?Yield, ?Await])Statement[?Yield, ?Await, ?Return]elseStatement[?Yield, ?Await, ?Return]
|
||||||
|
if(Expression[+In, ?Yield, ?Await])Statement[?Yield, ?Await, ?Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
UnaryExpression[Yield, Await]
|
||||||
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
|
AwaitExpression[Yield]:
|
||||||
|
await UnaryExpression[?Yield, +Await]
|
||||||
|
|
||||||
|
...
|
||||||
|
flags: [module]
|
||||||
|
features: [top-level-await]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (/*{ expr }*/) {}
|
25
src/top-level-await/syntax/top-level.template
Normal file
25
src/top-level-await/syntax/top-level.template
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/module-code/top-level-await/syntax/top-level-
|
||||||
|
name: Valid syntax for top level await.
|
||||||
|
esid: prod-AwaitExpression
|
||||||
|
info: |
|
||||||
|
ModuleItem:
|
||||||
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
UnaryExpression[Yield, Await]
|
||||||
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
|
AwaitExpression[Yield]:
|
||||||
|
await UnaryExpression[?Yield, +Await]
|
||||||
|
|
||||||
|
...
|
||||||
|
flags: [module]
|
||||||
|
features: [top-level-await]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
/*{ expr }*/;
|
@ -2,9 +2,9 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
path: language/module-code/top-level-await/syntax/try-
|
||||||
Valid syntax for top level await. It propagates to nested blocks
|
name: Valid syntax for top level await in try-catch-finally blocks.
|
||||||
TryStatement with AwaitExpression
|
esid: prod-AwaitExpression
|
||||||
info: |
|
info: |
|
||||||
ModuleItem:
|
ModuleItem:
|
||||||
StatementListItem[~Yield, +Await, ~Return]
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
@ -18,36 +18,33 @@ info: |
|
|||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
ExpressionStatement[Yield, Await]:
|
|
||||||
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
|
|
||||||
Expression[+In, ?Yield, ?Await];
|
|
||||||
|
|
||||||
UnaryExpression[Yield, Await]
|
UnaryExpression[Yield, Await]
|
||||||
[+Await]AwaitExpression[?Yield]
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
AwaitExpression[Yield]:
|
AwaitExpression[Yield]:
|
||||||
await UnaryExpression[?Yield, +Await]
|
await UnaryExpression[?Yield, +Await]
|
||||||
esid: prod-AwaitExpression
|
|
||||||
|
...
|
||||||
flags: [module]
|
flags: [module]
|
||||||
features: [top-level-await]
|
features: [top-level-await]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await 0;
|
/*{ expr }*/;
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
await 1;
|
/*{ expr }*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await 0;
|
/*{ expr }*/;
|
||||||
} finally {
|
} finally {
|
||||||
await 1;
|
/*{ expr }*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await 0;
|
/*{ expr }*/;
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
await 1;
|
/*{ expr }*/;
|
||||||
} finally {
|
} finally {
|
||||||
await 2;
|
/*{ expr }*/;
|
||||||
}
|
}
|
26
src/top-level-await/syntax/typeof.template
Normal file
26
src/top-level-await/syntax/typeof.template
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/module-code/top-level-await/syntax/typeof-
|
||||||
|
name: Valid syntax for top level await in an UnaryExpression (void).
|
||||||
|
esid: prod-AwaitExpression
|
||||||
|
info: |
|
||||||
|
ModuleItem:
|
||||||
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
UnaryExpression[Yield, Await]
|
||||||
|
typeof UnaryExpression[?Yield, ?Await]
|
||||||
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
|
AwaitExpression[Yield]:
|
||||||
|
await UnaryExpression[?Yield, +Await]
|
||||||
|
|
||||||
|
...
|
||||||
|
flags: [module]
|
||||||
|
features: [top-level-await]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
typeof /*{ expr }*/;
|
26
src/top-level-await/syntax/void.template
Normal file
26
src/top-level-await/syntax/void.template
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/module-code/top-level-await/syntax/void-
|
||||||
|
name: Valid syntax for top level await in an UnaryExpression (void).
|
||||||
|
esid: prod-AwaitExpression
|
||||||
|
info: |
|
||||||
|
ModuleItem:
|
||||||
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
UnaryExpression[Yield, Await]
|
||||||
|
void UnaryExpression[?Yield, ?Await]
|
||||||
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
|
AwaitExpression[Yield]:
|
||||||
|
await UnaryExpression[?Yield, +Await]
|
||||||
|
|
||||||
|
...
|
||||||
|
flags: [module]
|
||||||
|
features: [top-level-await]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
void /*{ expr }*/;
|
30
src/top-level-await/syntax/while-expr.template
Normal file
30
src/top-level-await/syntax/while-expr.template
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/module-code/top-level-await/syntax/while-
|
||||||
|
name: Valid syntax for top level await in an while expression position.
|
||||||
|
esid: prod-AwaitExpression
|
||||||
|
info: |
|
||||||
|
ModuleItem:
|
||||||
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
IterationStatement[Yield, Await, Return]:
|
||||||
|
while ( Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
UnaryExpression[Yield, Await]
|
||||||
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
|
AwaitExpression[Yield]:
|
||||||
|
await UnaryExpression[?Yield, +Await]
|
||||||
|
|
||||||
|
...
|
||||||
|
flags: [module]
|
||||||
|
features: [top-level-await]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
while (/*{ expr }*/) { break; }
|
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (C) 2019 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: >
|
||||||
|
Valid syntax for top level await.
|
||||||
|
AwaitExpression ImportCall
|
||||||
|
info: |
|
||||||
|
ModuleItem:
|
||||||
|
StatementListItem[~Yield, +Await, ~Return]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
UnaryExpression[Yield, Await]
|
||||||
|
[+Await]AwaitExpression[?Yield]
|
||||||
|
|
||||||
|
AwaitExpression[Yield]:
|
||||||
|
await UnaryExpression[?Yield, +Await]
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
TryStatement[Yield, Await, Return]:
|
||||||
|
try Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return]
|
||||||
|
try Block[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return]
|
||||||
|
try Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return]
|
||||||
|
|
||||||
|
Catch[Yield, Await, Return]:
|
||||||
|
catch(CatchParameter[?Yield, ?Await])Block[?Yield, ?Await, ?Return]
|
||||||
|
catchBlock[?Yield, ?Await, ?Return]
|
||||||
|
|
||||||
|
Finally[Yield, Await, Return]:
|
||||||
|
finallyBlock[?Yield, ?Await, ?Return]
|
||||||
|
|
||||||
|
CatchParameter[Yield, Await]:
|
||||||
|
BindingIdentifier[?Yield, ?Await]
|
||||||
|
BindingPattern[?Yield, ?Await]
|
||||||
|
esid: prod-AwaitExpression
|
||||||
|
flags: [module]
|
||||||
|
features: [top-level-await, dynamic-import]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
try {} catch (await e) {}
|
||||||
|
try {} catch (await {}) {}
|
||||||
|
try {} catch (await { x: await 42 }) {} // BindingElement
|
||||||
|
try {} catch (await { x = await 42 }) {} // Initializer
|
||||||
|
try {} catch (await []) {}
|
||||||
|
try {} catch (await [ x = await 42 ]) {}
|
Loading…
x
Reference in New Issue
Block a user