diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/block-await-expr-array-literal.js new file mode 100644 index 0000000000..15f7d604e5 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-array-literal.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await []; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/block-await-expr-func-expression.js new file mode 100644 index 0000000000..523c697c83 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-func-expression.js @@ -0,0 +1,82 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await function() {}; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/block-await-expr-identifier.js new file mode 100644 index 0000000000..1bc509e28f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-identifier.js @@ -0,0 +1,77 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await foo; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/block-await-expr-literal-number.js new file mode 100644 index 0000000000..875fab8a00 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-literal-number.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await 1; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/block-await-expr-literal-string.js new file mode 100644 index 0000000000..50e337405b --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-literal-string.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await ''; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/block-await-expr-nested.js new file mode 100644 index 0000000000..dc94f10882 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-nested.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/block.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await await await await await await await await await await await await await await await 'await'; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/block-await-expr-new-expr.js new file mode 100644 index 0000000000..df273c3a7b --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-new-expr.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await new Promise(function(res, rej) { res(1); }); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-null.js b/test/language/module-code/top-level-await/syntax/block-await-expr-null.js new file mode 100644 index 0000000000..3161245864 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-null.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await null; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/block-await-expr-obj-literal.js new file mode 100644 index 0000000000..9e6883fc1f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-obj-literal.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await { function() {} }; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/block-await-expr-regexp.js new file mode 100644 index 0000000000..644c79de64 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-regexp.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await /1/; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/block-await-expr-template-literal.js new file mode 100644 index 0000000000..679927f6bf --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-template-literal.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await ``; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/block-await-expr-this.js b/test/language/module-code/top-level-await/syntax/block-await-expr-this.js new file mode 100644 index 0000000000..659d750254 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/block-await-expr-this.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/block.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in a block.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +{ + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + { + await this; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-array-literal.js new file mode 100644 index 0000000000..db67bdd2b5 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-array-literal.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await []) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-func-expression.js new file mode 100644 index 0000000000..3e6bf515ab --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-func-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await function() {}) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-identifier.js new file mode 100644 index 0000000000..3c028b8c3c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-identifier.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await foo) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-number.js new file mode 100644 index 0000000000..7f9cc92557 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-number.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await 1) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-string.js new file mode 100644 index 0000000000..cb011182bd --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-literal-string.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await '') {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-nested.js new file mode 100644 index 0000000000..49c3ee205e --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-nested.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await await await await await await await await await await await await await await await 'await') {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-new-expr.js new file mode 100644 index 0000000000..bdc4db1d92 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-new-expr.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await new Promise(function(res, rej) { res(1); })) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-null.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-null.js new file mode 100644 index 0000000000..a5c49dd95f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-null.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await null) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-obj-literal.js new file mode 100644 index 0000000000..5076f02152 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-obj-literal.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await { function() {} }) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-regexp.js new file mode 100644 index 0000000000..21b6a99add --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-regexp.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await /1/) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-template-literal.js new file mode 100644 index 0000000000..a66f4df825 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-template-literal.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await ``) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-this.js b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-this.js new file mode 100644 index 0000000000..914aff60e8 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-class-decl-await-expr-this.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/export-class-decl.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in export ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export class C extends fn(await this) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-array-literal.js new file mode 100644 index 0000000000..d6970d67e8 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-array-literal.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export default await []; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-func-expression.js new file mode 100644 index 0000000000..d8dae18bc0 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-func-expression.js @@ -0,0 +1,70 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export default await function() {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-identifier.js new file mode 100644 index 0000000000..8a809c3ffb --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-identifier.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +export default await foo; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-number.js new file mode 100644 index 0000000000..5ac11cdf3d --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-number.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export default await 1; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-string.js new file mode 100644 index 0000000000..fdfe462284 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-literal-string.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export default await ''; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-nested.js new file mode 100644 index 0000000000..4ff0691b3d --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-nested.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +export default await await await await await await await await await await await await await await await 'await'; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-new-expr.js new file mode 100644 index 0000000000..0efb0170db --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-new-expr.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +export default await new Promise(function(res, rej) { res(1); }); diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-null.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-null.js new file mode 100644 index 0000000000..7032b0f000 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-null.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export default await null; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-obj-literal.js new file mode 100644 index 0000000000..ea1d44cee7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-obj-literal.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export default await { function() {} }; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-regexp.js new file mode 100644 index 0000000000..6b01200c12 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-regexp.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export default await /1/; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-template-literal.js new file mode 100644 index 0000000000..174db4a959 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-template-literal.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export default await ``; diff --git a/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-this.js b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-this.js new file mode 100644 index 0000000000..5bf9891ce9 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dflt-assign-expr-await-expr-this.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/export-dflt-assign-expr.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in export default AssignmentExpression) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default [lookahead ∉ { function, async [no LineTerminator here] function, class }] AssignmentExpression [+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export default await this; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-array-literal.js new file mode 100644 index 0000000000..de508769be --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-array-literal.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await []) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-func-expression.js new file mode 100644 index 0000000000..aab208ce68 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-func-expression.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await function() {}) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-identifier.js new file mode 100644 index 0000000000..dc2897b533 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-identifier.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await foo) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-number.js new file mode 100644 index 0000000000..a9586e7ec3 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-number.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await 1) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-string.js new file mode 100644 index 0000000000..f229e0dab7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-literal-string.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await '') {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-nested.js new file mode 100644 index 0000000000..3f90ef0018 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-nested.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await await await await await await await await await await await await await await await 'await') {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-new-expr.js new file mode 100644 index 0000000000..e0835c8e40 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-new-expr.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await new Promise(function(res, rej) { res(1); })) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-null.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-null.js new file mode 100644 index 0000000000..88aa9b4f5f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-null.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await null) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-obj-literal.js new file mode 100644 index 0000000000..45c17ab52b --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-obj-literal.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await { function() {} }) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-regexp.js new file mode 100644 index 0000000000..4ca43831e3 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-regexp.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await /1/) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-template-literal.js new file mode 100644 index 0000000000..33f6e826ee --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-template-literal.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await ``) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-this.js b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-this.js new file mode 100644 index 0000000000..f959b56389 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-dft-class-decl-await-expr-this.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/export-dflt-class-decl.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in export default ClassDeclaration) +esid: prod-AwaitExpression +features: [top-level-await, class] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + ClassDeclaration[Yield, Await, Default]: + classBindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] class ClassTail[?Yield, ?Await] + + ClassTail[Yield, Await]: + ClassHeritage[?Yield, ?Await]_opt { ClassBody[?Yield, ?Await]_opt } + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +function fn() { + return function() {}; +} +// extends CallExpression with arguments +export default class extends fn(await this) {}; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-array-literal.js new file mode 100644 index 0000000000..8cc3b6df55 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-array-literal.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export let x = await []; +export const y = await []; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-func-expression.js new file mode 100644 index 0000000000..faad53d6dd --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-func-expression.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export let x = await function() {}; +export const y = await function() {}; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-identifier.js new file mode 100644 index 0000000000..1669f53918 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-identifier.js @@ -0,0 +1,62 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +export let x = await foo; +export const y = await foo; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-number.js new file mode 100644 index 0000000000..964b6e7080 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-number.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export let x = await 1; +export const y = await 1; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-string.js new file mode 100644 index 0000000000..5cd34a4186 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-literal-string.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export let x = await ''; +export const y = await ''; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-nested.js new file mode 100644 index 0000000000..d8fb289c13 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-nested.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +export let x = await await await await await await await await await await await await await await await 'await'; +export const y = await await await await await await await await await await await await await await await 'await'; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-new-expr.js new file mode 100644 index 0000000000..a75c71ceb7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-new-expr.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +export let x = await new Promise(function(res, rej) { res(1); }); +export const y = await new Promise(function(res, rej) { res(1); }); diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-null.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-null.js new file mode 100644 index 0000000000..20dbe2c233 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-null.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export let x = await null; +export const y = await null; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-obj-literal.js new file mode 100644 index 0000000000..2fc5a788ed --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-obj-literal.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export let x = await { function() {} }; +export const y = await { function() {} }; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-regexp.js new file mode 100644 index 0000000000..4d8d6c8ed1 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-regexp.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export let x = await /1/; +export const y = await /1/; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-template-literal.js new file mode 100644 index 0000000000..325eedfee9 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-template-literal.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export let x = await ``; +export const y = await ``; diff --git a/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-this.js b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-this.js new file mode 100644 index 0000000000..7059f12cdb --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-lex-decl-await-expr-this.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/export-lex-declaration.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in export LexicalDeclaration) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + Declaration[Yield, Await]: + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] + + LexicalDeclaration[In, Yield, Await]: + LetOrConstBindingList[?In, ?Yield, ?Await]; + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export let x = await this; +export const y = await this; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-array-literal.js new file mode 100644 index 0000000000..3efa31140a --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-array-literal.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export var name1 = await []; +export var { x = await [] } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-func-expression.js new file mode 100644 index 0000000000..28a7c07d42 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-func-expression.js @@ -0,0 +1,70 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export var name1 = await function() {}; +export var { x = await function() {} } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-identifier.js new file mode 100644 index 0000000000..4434676d20 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-identifier.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +export var name1 = await foo; +export var { x = await foo } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-literal-number.js new file mode 100644 index 0000000000..93491fdff1 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-literal-number.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export var name1 = await 1; +export var { x = await 1 } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-literal-string.js new file mode 100644 index 0000000000..38d0c80feb --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-literal-string.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export var name1 = await ''; +export var { x = await '' } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-nested.js new file mode 100644 index 0000000000..41321df597 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-nested.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +export var name1 = await await await await await await await await await await await await await await await 'await'; +export var { x = await await await await await await await await await await await await await await await 'await' } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-new-expr.js new file mode 100644 index 0000000000..7317c17be3 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-new-expr.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +export var name1 = await new Promise(function(res, rej) { res(1); }); +export var { x = await new Promise(function(res, rej) { res(1); }) } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-null.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-null.js new file mode 100644 index 0000000000..4677cfcc0f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-null.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export var name1 = await null; +export var { x = await null } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-obj-literal.js new file mode 100644 index 0000000000..7f93371e36 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-obj-literal.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export var name1 = await { function() {} }; +export var { x = await { function() {} } } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-regexp.js new file mode 100644 index 0000000000..8c387e7659 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-regexp.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export var name1 = await /1/; +export var { x = await /1/ } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-template-literal.js new file mode 100644 index 0000000000..c55bc8cd3a --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-template-literal.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export var name1 = await ``; +export var { x = await `` } = {}; diff --git a/test/language/module-code/top-level-await/syntax/export-var-await-expr-this.js b/test/language/module-code/top-level-await/syntax/export-var-await-expr-this.js new file mode 100644 index 0000000000..0284f2ed6c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/export-var-await-expr-this.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/export-var-init.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in export var BindingIdentifier Await_initializer) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + ExportDeclaration: + export * FromClause ; + export ExportClause FromClause ; + export ExportClause ; + export VariableStatement[~Yield, +Await] + export Declaration[~Yield, +Await] + export defaultHoistableDeclaration[~Yield, +Await, +Default] + export defaultClassDeclaration[~Yield, +Await, +Default] + export default[lookahead ∉ { function, async [no LineTerminator here] function, class }]AssignmentExpression[+In, ~Yield, ~Await]; + + VariableStatement[Yield, Await]: + var VariableDeclarationList[+In, ?Yield, ?Await]; + + VariableDeclarationList[In, Yield, Await]: + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] , VariableDeclaration[?In, ?Yield, ?Await] + + VariableDeclaration[In, Yield, Await]: + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]opt + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +export var name1 = await this; +export var { x = await this } = {}; diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-array-literal.js new file mode 100644 index 0000000000..cf28a32ee1 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-array-literal.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await []]) { + await []; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await []]) { + await []; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await []]) { + await []; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-func-expression.js new file mode 100644 index 0000000000..586a8c0ebe --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-func-expression.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await function() {}]) { + await function() {}; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await function() {}]) { + await function() {}; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await function() {}]) { + await function() {}; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-identifier.js new file mode 100644 index 0000000000..9c2103e226 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-identifier.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await foo]) { + await foo; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await foo]) { + await foo; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await foo]) { + await foo; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-literal-number.js new file mode 100644 index 0000000000..7a63f84690 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-literal-number.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await 1]) { + await 1; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await 1]) { + await 1; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await 1]) { + await 1; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-literal-string.js new file mode 100644 index 0000000000..ccf8165910 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-literal-string.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await '']) { + await ''; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await '']) { + await ''; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await '']) { + await ''; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-nested.js new file mode 100644 index 0000000000..5ddb319a88 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-nested.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await await await await await await await await await await await await await await await 'await']) { + await await await await await await await await await await await await await await await 'await'; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await await await await await await await await await await await await await await await 'await']) { + await await await await await await await await await await await await await await await 'await'; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await await await await await await await await await await await await await await await 'await']) { + await await await await await await await await await await await await await await await 'await'; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-new-expr.js new file mode 100644 index 0000000000..34919e70ba --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-new-expr.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await new Promise(function(res, rej) { res(1); })]) { + await new Promise(function(res, rej) { res(1); }); + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await new Promise(function(res, rej) { res(1); })]) { + await new Promise(function(res, rej) { res(1); }); + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await new Promise(function(res, rej) { res(1); })]) { + await new Promise(function(res, rej) { res(1); }); + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-null.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-null.js new file mode 100644 index 0000000000..0884f51fa7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-null.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await null]) { + await null; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await null]) { + await null; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await null]) { + await null; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-obj-literal.js new file mode 100644 index 0000000000..09728b2057 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-obj-literal.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await { function() {} }]) { + await { function() {} }; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await { function() {} }]) { + await { function() {} }; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await { function() {} }]) { + await { function() {} }; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-regexp.js new file mode 100644 index 0000000000..e50f6227cc --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-regexp.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await /1/]) { + await /1/; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await /1/]) { + await /1/; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await /1/]) { + await /1/; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-template-literal.js new file mode 100644 index 0000000000..bf51fcea42 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-template-literal.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await ``]) { + await ``; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await ``]) { + await ``; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await ``]) { + await ``; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-await-expr-this.js b/test/language/module-code/top-level-await/syntax/for-await-await-expr-this.js new file mode 100644 index 0000000000..61632fceb8 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-await-expr-this.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/for-await-expr.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in for await statements.) +esid: prod-AwaitExpression +features: [top-level-await, async-iteration] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// [+Await]for await ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (binding of [await this]) { + await this; + break; +} + +// [+Await]for await ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (var binding of [await this]) { + await this; + break; +} + +// [+Await]for await ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for await (let binding of [await this]) { + await this; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/for-await-expr-array-literal.js new file mode 100644 index 0000000000..6c761cc5d4 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-array-literal.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await [] ; await []; await [] ) { + await []; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await []; await [] ) { + await []; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await []; await [] ) { + await []; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/for-await-expr-func-expression.js new file mode 100644 index 0000000000..fa44232e79 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-func-expression.js @@ -0,0 +1,79 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await function() {} ; await function() {}; await function() {} ) { + await function() {}; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await function() {}; await function() {} ) { + await function() {}; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await function() {}; await function() {} ) { + await function() {}; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/for-await-expr-identifier.js new file mode 100644 index 0000000000..b9fb22ec1a --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-identifier.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await foo ; await foo; await foo ) { + await foo; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await foo; await foo ) { + await foo; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await foo; await foo ) { + await foo; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/for-await-expr-literal-number.js new file mode 100644 index 0000000000..ab316345b4 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-literal-number.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await 1 ; await 1; await 1 ) { + await 1; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await 1; await 1 ) { + await 1; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await 1; await 1 ) { + await 1; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/for-await-expr-literal-string.js new file mode 100644 index 0000000000..850cf75d55 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-literal-string.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await '' ; await ''; await '' ) { + await ''; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await ''; await '' ) { + await ''; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await ''; await '' ) { + await ''; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/for-await-expr-nested.js new file mode 100644 index 0000000000..f2e2aca5d4 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-nested.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await await await await await await await await await await await await await await await 'await' ; await await await await await await await await await await await await await await await 'await'; await await await await await await await await await await await await await await await 'await' ) { + await await await await await await await await await await await await await await await 'await'; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await await await await await await await await await await await await await await await 'await'; await await await await await await await await await await await await await await await 'await' ) { + await await await await await await await await await await await await await await await 'await'; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await await await await await await await await await await await await await await await 'await'; await await await await await await await await await await await await await await await 'await' ) { + await await await await await await await await await await await await await await await 'await'; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/for-await-expr-new-expr.js new file mode 100644 index 0000000000..fe47b20a4b --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-new-expr.js @@ -0,0 +1,70 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await new Promise(function(res, rej) { res(1); }) ; await new Promise(function(res, rej) { res(1); }); await new Promise(function(res, rej) { res(1); }) ) { + await new Promise(function(res, rej) { res(1); }); + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await new Promise(function(res, rej) { res(1); }); await new Promise(function(res, rej) { res(1); }) ) { + await new Promise(function(res, rej) { res(1); }); + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await new Promise(function(res, rej) { res(1); }); await new Promise(function(res, rej) { res(1); }) ) { + await new Promise(function(res, rej) { res(1); }); + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-null.js b/test/language/module-code/top-level-await/syntax/for-await-expr-null.js new file mode 100644 index 0000000000..4b6e36696a --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-null.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await null ; await null; await null ) { + await null; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await null; await null ) { + await null; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await null; await null ) { + await null; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/for-await-expr-obj-literal.js new file mode 100644 index 0000000000..ea8ed4c571 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-obj-literal.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await { function() {} } ; await { function() {} }; await { function() {} } ) { + await { function() {} }; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await { function() {} }; await { function() {} } ) { + await { function() {} }; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await { function() {} }; await { function() {} } ) { + await { function() {} }; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/for-await-expr-regexp.js new file mode 100644 index 0000000000..0a7d8144eb --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-regexp.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await /1/ ; await /1/; await /1/ ) { + await /1/; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await /1/; await /1/ ) { + await /1/; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await /1/; await /1/ ) { + await /1/; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/for-await-expr-template-literal.js new file mode 100644 index 0000000000..3467adb121 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-template-literal.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await `` ; await ``; await `` ) { + await ``; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await ``; await `` ) { + await ``; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await ``; await `` ) { + await ``; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-await-expr-this.js b/test/language/module-code/top-level-await/syntax/for-await-expr-this.js new file mode 100644 index 0000000000..2aee1be768 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-await-expr-this.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/for-expr.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in for statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +// for ( [ lookahead ≠ let [] Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( await this ; await this; await this ) { + await this; + break; +} + +// for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( var binding; await this; await this ) { + await this; + break; +} + +// for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] +for ( let binding; await this; await this ) { + await this; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-array-literal.js new file mode 100644 index 0000000000..5ca23086c0 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-array-literal.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await []]) { + await []; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await []]) { + await []; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await []]) { + await []; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-func-expression.js new file mode 100644 index 0000000000..6797e1f7c6 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-func-expression.js @@ -0,0 +1,81 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await function() {}]) { + await function() {}; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await function() {}]) { + await function() {}; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await function() {}]) { + await function() {}; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-identifier.js new file mode 100644 index 0000000000..4eae7adea3 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-identifier.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await foo]) { + await foo; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await foo]) { + await foo; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await foo]) { + await foo; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-literal-number.js new file mode 100644 index 0000000000..563ae8be46 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-literal-number.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await 1]) { + await 1; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await 1]) { + await 1; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await 1]) { + await 1; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-literal-string.js new file mode 100644 index 0000000000..ca9a35d595 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-literal-string.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await '']) { + await ''; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await '']) { + await ''; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await '']) { + await ''; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-nested.js new file mode 100644 index 0000000000..4eb99b87f7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-nested.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await await await await await await await await await await await await await await await 'await']) { + await await await await await await await await await await await await await await await 'await'; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await await await await await await await await await await await await await await await 'await']) { + await await await await await await await await await await await await await await await 'await'; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await await await await await await await await await await await await await await await 'await']) { + await await await await await await await await await await await await await await await 'await'; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-new-expr.js new file mode 100644 index 0000000000..6091c3c159 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-new-expr.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await new Promise(function(res, rej) { res(1); })]) { + await new Promise(function(res, rej) { res(1); }); + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await new Promise(function(res, rej) { res(1); })]) { + await new Promise(function(res, rej) { res(1); }); + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await new Promise(function(res, rej) { res(1); })]) { + await new Promise(function(res, rej) { res(1); }); + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-null.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-null.js new file mode 100644 index 0000000000..9eb56aac2b --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-null.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await null]) { + await null; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await null]) { + await null; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await null]) { + await null; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-obj-literal.js new file mode 100644 index 0000000000..2c4bf7fd6f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-obj-literal.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await { function() {} }]) { + await { function() {} }; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await { function() {} }]) { + await { function() {} }; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await { function() {} }]) { + await { function() {} }; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-regexp.js new file mode 100644 index 0000000000..6bec21089c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-regexp.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await /1/]) { + await /1/; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await /1/]) { + await /1/; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await /1/]) { + await /1/; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-template-literal.js new file mode 100644 index 0000000000..111de92763 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-template-literal.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await ``]) { + await ``; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await ``]) { + await ``; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await ``]) { + await ``; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-in-await-expr-this.js b/test/language/module-code/top-level-await/syntax/for-in-await-expr-this.js new file mode 100644 index 0000000000..9926cc54fb --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-in-await-expr-this.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/for-in-expr.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in for-in statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding in [await this]) { + await this; + break; +} + +// for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding in [await this]) { + await this; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding in [await this]) { + await this; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-array-literal.js new file mode 100644 index 0000000000..8ca707ac76 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-array-literal.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await []]) { + await []; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await []]) { + await []; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await []]) { + await []; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-func-expression.js new file mode 100644 index 0000000000..1661a1af15 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-func-expression.js @@ -0,0 +1,81 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await function() {}]) { + await function() {}; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await function() {}]) { + await function() {}; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await function() {}]) { + await function() {}; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-identifier.js new file mode 100644 index 0000000000..3683460dd9 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-identifier.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await foo]) { + await foo; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await foo]) { + await foo; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await foo]) { + await foo; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-literal-number.js new file mode 100644 index 0000000000..33728cf740 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-literal-number.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await 1]) { + await 1; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await 1]) { + await 1; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await 1]) { + await 1; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-literal-string.js new file mode 100644 index 0000000000..85e6fd22c2 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-literal-string.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await '']) { + await ''; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await '']) { + await ''; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await '']) { + await ''; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-nested.js new file mode 100644 index 0000000000..d955eea7f7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-nested.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await await await await await await await await await await await await await await await 'await']) { + await await await await await await await await await await await await await await await 'await'; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await await await await await await await await await await await await await await await 'await']) { + await await await await await await await await await await await await await await await 'await'; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await await await await await await await await await await await await await await await 'await']) { + await await await await await await await await await await await await await await await 'await'; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-new-expr.js new file mode 100644 index 0000000000..ac00e55edd --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-new-expr.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await new Promise(function(res, rej) { res(1); })]) { + await new Promise(function(res, rej) { res(1); }); + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await new Promise(function(res, rej) { res(1); })]) { + await new Promise(function(res, rej) { res(1); }); + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await new Promise(function(res, rej) { res(1); })]) { + await new Promise(function(res, rej) { res(1); }); + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-null.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-null.js new file mode 100644 index 0000000000..4ff1112d79 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-null.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await null]) { + await null; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await null]) { + await null; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await null]) { + await null; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-obj-literal.js new file mode 100644 index 0000000000..65f32d420d --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-obj-literal.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await { function() {} }]) { + await { function() {} }; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await { function() {} }]) { + await { function() {} }; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await { function() {} }]) { + await { function() {} }; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-regexp.js new file mode 100644 index 0000000000..c1c52e6d39 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-regexp.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await /1/]) { + await /1/; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await /1/]) { + await /1/; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await /1/]) { + await /1/; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-template-literal.js new file mode 100644 index 0000000000..a5f6a2ebad --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-template-literal.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await ``]) { + await ``; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await ``]) { + await ``; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await ``]) { + await ``; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/for-of-await-expr-this.js b/test/language/module-code/top-level-await/syntax/for-of-await-expr-this.js new file mode 100644 index 0000000000..37668779f3 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/for-of-await-expr-this.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/for-of-expr.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in for-of statements.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + IterationStatement[Yield, Await, Return]: + ... + for ( [ lookahead ≠ let []Expression[~In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( var VariableDeclarationList[~In, ?Yield, ?Await] ; Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]opt ; Expression[+In, ?Yield, ?Await]opt ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let [] LeftHandSideExpression[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] in Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] + ... + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +var binding; + +// for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (binding of [await this]) { + await this; + break; +} + +// for ( var ForBinding[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (var binding of [await this]) { + await this; + break; +} + +// for ( ForDeclaration[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] +for (let binding of [await this]) { + await this; + break; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-array-literal.js new file mode 100644 index 0000000000..5f7299ab9a --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-array-literal.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (true) { + await []; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-func-expression.js new file mode 100644 index 0000000000..d4217a3cb7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-func-expression.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (true) { + await function() {}; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-identifier.js new file mode 100644 index 0000000000..6ad1f20ba2 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-identifier.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +if (true) { + await foo; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-literal-number.js new file mode 100644 index 0000000000..6a0f754151 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-literal-number.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (true) { + await 1; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-literal-string.js new file mode 100644 index 0000000000..7f3eace91a --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-literal-string.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (true) { + await ''; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-nested.js new file mode 100644 index 0000000000..68e8bdaf97 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-nested.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +if (true) { + await await await await await await await await await await await await await await await 'await'; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-new-expr.js new file mode 100644 index 0000000000..aeb6f4aa8e --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-new-expr.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +if (true) { + await new Promise(function(res, rej) { res(1); }); +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-null.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-null.js new file mode 100644 index 0000000000..6aa4de4db8 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-null.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (true) { + await null; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-obj-literal.js new file mode 100644 index 0000000000..c08aeb1ea8 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-obj-literal.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (true) { + await { function() {} }; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-regexp.js new file mode 100644 index 0000000000..08b3f6e8f6 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-regexp.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (true) { + await /1/; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-template-literal.js new file mode 100644 index 0000000000..559abb49ef --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-template-literal.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (true) { + await ``; +} diff --git a/test/language/module-code/top-level-await/syntax/if-block-await-expr-this.js b/test/language/module-code/top-level-await/syntax/if-block-await-expr-this.js new file mode 100644 index 0000000000..ba3d72dd5c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-block-await-expr-this.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/if-block.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (true) { + await this; +} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-array-literal.js new file mode 100644 index 0000000000..a1c9154455 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-array-literal.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (await []) {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-func-expression.js new file mode 100644 index 0000000000..bed37b8eee --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-func-expression.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (await function() {}) {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-identifier.js new file mode 100644 index 0000000000..f0a6c90755 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-identifier.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +if (await foo) {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-literal-number.js new file mode 100644 index 0000000000..cb73ab9054 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-literal-number.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (await 1) {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-literal-string.js new file mode 100644 index 0000000000..7af24f610c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-literal-string.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (await '') {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-nested.js new file mode 100644 index 0000000000..65194072bb --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-nested.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +if (await await await await await await await await await await await await await await await 'await') {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-new-expr.js new file mode 100644 index 0000000000..0be5953dcc --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-new-expr.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +if (await new Promise(function(res, rej) { res(1); })) {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-null.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-null.js new file mode 100644 index 0000000000..5f431b87cd --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-null.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (await null) {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-obj-literal.js new file mode 100644 index 0000000000..4a3a343e71 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-obj-literal.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (await { function() {} }) {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-regexp.js new file mode 100644 index 0000000000..16faf2850f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-regexp.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (await /1/) {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-template-literal.js new file mode 100644 index 0000000000..6059914b8c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-template-literal.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (await ``) {} diff --git a/test/language/module-code/top-level-await/syntax/if-expr-await-expr-this.js b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-this.js new file mode 100644 index 0000000000..cafee5c8da --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/if-expr-await-expr-this.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/if-expr.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in an if expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +if (await this) {} diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-array-literal.js new file mode 100644 index 0000000000..e14932cf3a --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-array-literal.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +await []; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-func-expression.js new file mode 100644 index 0000000000..d021abfc4d --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-func-expression.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +await function() {}; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-identifier.js new file mode 100644 index 0000000000..f9188aa16e --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-identifier.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +await foo; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-literal-number.js new file mode 100644 index 0000000000..f5a1e54e22 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-literal-number.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +await 1; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-literal-string.js new file mode 100644 index 0000000000..8167dce55f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-literal-string.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +await ''; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-nested.js new file mode 100644 index 0000000000..ce90f553ca --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-nested.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +await await await await await await await await await await await await await await await 'await'; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-new-expr.js new file mode 100644 index 0000000000..193ba1472c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-new-expr.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +await new Promise(function(res, rej) { res(1); }); diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-null.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-null.js new file mode 100644 index 0000000000..e0c01bc6d7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-null.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +await null; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-obj-literal.js new file mode 100644 index 0000000000..0bb63836cf --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-obj-literal.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +await { function() {} }; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-regexp.js new file mode 100644 index 0000000000..be5bb22eba --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-regexp.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +await /1/; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-template-literal.js new file mode 100644 index 0000000000..ea556e87c7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-template-literal.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +await ``; diff --git a/test/language/module-code/top-level-await/syntax/top-level-await-expr-this.js b/test/language/module-code/top-level-await/syntax/top-level-await-expr-this.js new file mode 100644 index 0000000000..8a70bea20c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/top-level-await-expr-this.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/top-level.template +/*--- +description: AwaitExpression this (Valid syntax for top level await.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +await this; diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/try-await-expr-array-literal.js new file mode 100644 index 0000000000..50d9b2d078 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-array-literal.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +try { + await []; +} catch(e) { + await []; +} + +try { + await []; +} finally { + await []; +} + +try { + await []; +} catch(e) { + await []; +} finally { + await []; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/try-await-expr-func-expression.js new file mode 100644 index 0000000000..141fcece23 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-func-expression.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +try { + await function() {}; +} catch(e) { + await function() {}; +} + +try { + await function() {}; +} finally { + await function() {}; +} + +try { + await function() {}; +} catch(e) { + await function() {}; +} finally { + await function() {}; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/try-await-expr-identifier.js new file mode 100644 index 0000000000..2ccb9b9bb8 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-identifier.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +try { + await foo; +} catch(e) { + await foo; +} + +try { + await foo; +} finally { + await foo; +} + +try { + await foo; +} catch(e) { + await foo; +} finally { + await foo; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/try-await-expr-literal-number.js new file mode 100644 index 0000000000..276a55042b --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-literal-number.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +try { + await 1; +} catch(e) { + await 1; +} + +try { + await 1; +} finally { + await 1; +} + +try { + await 1; +} catch(e) { + await 1; +} finally { + await 1; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/try-await-expr-literal-string.js new file mode 100644 index 0000000000..87980035a1 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-literal-string.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +try { + await ''; +} catch(e) { + await ''; +} + +try { + await ''; +} finally { + await ''; +} + +try { + await ''; +} catch(e) { + await ''; +} finally { + await ''; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/try-await-expr-nested.js new file mode 100644 index 0000000000..87213372bd --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-nested.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/try.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +try { + await await await await await await await await await await await await await await await 'await'; +} catch(e) { + await await await await await await await await await await await await await await await 'await'; +} + +try { + await await await await await await await await await await await await await await await 'await'; +} finally { + await await await await await await await await await await await await await await await 'await'; +} + +try { + await await await await await await await await await await await await await await await 'await'; +} catch(e) { + await await await await await await await await await await await await await await await 'await'; +} finally { + await await await await await await await await await await await await await await await 'await'; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/try-await-expr-new-expr.js new file mode 100644 index 0000000000..157de1f22b --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-new-expr.js @@ -0,0 +1,64 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +try { + await new Promise(function(res, rej) { res(1); }); +} catch(e) { + await new Promise(function(res, rej) { res(1); }); +} + +try { + await new Promise(function(res, rej) { res(1); }); +} finally { + await new Promise(function(res, rej) { res(1); }); +} + +try { + await new Promise(function(res, rej) { res(1); }); +} catch(e) { + await new Promise(function(res, rej) { res(1); }); +} finally { + await new Promise(function(res, rej) { res(1); }); +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-null.js b/test/language/module-code/top-level-await/syntax/try-await-expr-null.js new file mode 100644 index 0000000000..42831a1d5b --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-null.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +try { + await null; +} catch(e) { + await null; +} + +try { + await null; +} finally { + await null; +} + +try { + await null; +} catch(e) { + await null; +} finally { + await null; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/try-await-expr-obj-literal.js new file mode 100644 index 0000000000..85ed62ce8f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-obj-literal.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +try { + await { function() {} }; +} catch(e) { + await { function() {} }; +} + +try { + await { function() {} }; +} finally { + await { function() {} }; +} + +try { + await { function() {} }; +} catch(e) { + await { function() {} }; +} finally { + await { function() {} }; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/try-await-expr-regexp.js new file mode 100644 index 0000000000..2b349c5247 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-regexp.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +try { + await /1/; +} catch(e) { + await /1/; +} + +try { + await /1/; +} finally { + await /1/; +} + +try { + await /1/; +} catch(e) { + await /1/; +} finally { + await /1/; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/try-await-expr-template-literal.js new file mode 100644 index 0000000000..0460e4446c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-template-literal.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +try { + await ``; +} catch(e) { + await ``; +} + +try { + await ``; +} finally { + await ``; +} + +try { + await ``; +} catch(e) { + await ``; +} finally { + await ``; +} diff --git a/test/language/module-code/top-level-await/syntax/try-await-expr-this.js b/test/language/module-code/top-level-await/syntax/try-await-expr-this.js new file mode 100644 index 0000000000..8a03be93ba --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/try-await-expr-this.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/try.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in try-catch-finally blocks.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + 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] + + ... + + UnaryExpression[Yield, Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +try { + await this; +} catch(e) { + await this; +} + +try { + await this; +} finally { + await this; +} + +try { + await this; +} catch(e) { + await this; +} finally { + await this; +} diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-array-literal.js new file mode 100644 index 0000000000..8ec0fa6d61 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-array-literal.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +typeof await []; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-func-expression.js new file mode 100644 index 0000000000..fa58fb983e --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-func-expression.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +typeof await function() {}; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-identifier.js new file mode 100644 index 0000000000..1cbc89526a --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-identifier.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +typeof await foo; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-literal-number.js new file mode 100644 index 0000000000..5f3bea66a8 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-literal-number.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +typeof await 1; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-literal-string.js new file mode 100644 index 0000000000..fb286d3bee --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-literal-string.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +typeof await ''; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-nested.js new file mode 100644 index 0000000000..b97e047e28 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-nested.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +typeof await await await await await await await await await await await await await await await 'await'; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-new-expr.js new file mode 100644 index 0000000000..74fc0200da --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-new-expr.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +typeof await new Promise(function(res, rej) { res(1); }); diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-null.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-null.js new file mode 100644 index 0000000000..3179ef0d96 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-null.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +typeof await null; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-obj-literal.js new file mode 100644 index 0000000000..a6ef106d41 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-obj-literal.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +typeof await { function() {} }; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-regexp.js new file mode 100644 index 0000000000..349638cae7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-regexp.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +typeof await /1/; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-template-literal.js new file mode 100644 index 0000000000..ba294c518f --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-template-literal.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +typeof await ``; diff --git a/test/language/module-code/top-level-await/syntax/typeof-await-expr-this.js b/test/language/module-code/top-level-await/syntax/typeof-await-expr-this.js new file mode 100644 index 0000000000..cd4ee4b183 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/typeof-await-expr-this.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/typeof.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + typeof UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +typeof await this; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/void-await-expr-array-literal.js new file mode 100644 index 0000000000..d32497c08a --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-array-literal.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +void await []; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/void-await-expr-func-expression.js new file mode 100644 index 0000000000..ef5f4b45d0 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-func-expression.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +void await function() {}; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/void-await-expr-identifier.js new file mode 100644 index 0000000000..85fdd102c5 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-identifier.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +void await foo; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/void-await-expr-literal-number.js new file mode 100644 index 0000000000..5bb2b990c7 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-literal-number.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +void await 1; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/void-await-expr-literal-string.js new file mode 100644 index 0000000000..b5dbe8e46c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-literal-string.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +void await ''; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/void-await-expr-nested.js new file mode 100644 index 0000000000..9c02d0e6ad --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-nested.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/void.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +void await await await await await await await await await await await await await await await 'await'; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/void-await-expr-new-expr.js new file mode 100644 index 0000000000..68a84a4288 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-new-expr.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +void await new Promise(function(res, rej) { res(1); }); diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-null.js b/test/language/module-code/top-level-await/syntax/void-await-expr-null.js new file mode 100644 index 0000000000..11bfc5abe0 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-null.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +void await null; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/void-await-expr-obj-literal.js new file mode 100644 index 0000000000..26a4ea229c --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-obj-literal.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +void await { function() {} }; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/void-await-expr-regexp.js new file mode 100644 index 0000000000..fb39dd76f0 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-regexp.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +void await /1/; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/void-await-expr-template-literal.js new file mode 100644 index 0000000000..abd3695566 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-template-literal.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +void await ``; diff --git a/test/language/module-code/top-level-await/syntax/void-await-expr-this.js b/test/language/module-code/top-level-await/syntax/void-await-expr-this.js new file mode 100644 index 0000000000..a2a4fc9587 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/void-await-expr-this.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/void.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in an UnaryExpression (void).) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +info: | + ModuleItem: + StatementListItem[~Yield, +Await, ~Return] + + ... + + UnaryExpression[Yield, Await] + void UnaryExpression[?Yield, ?Await] + [+Await]AwaitExpression[?Yield] + + AwaitExpression[Yield]: + await UnaryExpression[?Yield, +Await] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +void await this; diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-array-literal.js b/test/language/module-code/top-level-await/syntax/while-await-expr-array-literal.js new file mode 100644 index 0000000000..6cf2df1fcf --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-array-literal.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-array-literal.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression ArrayLiteral (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +while (await []) { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-func-expression.js b/test/language/module-code/top-level-await/syntax/while-await-expr-func-expression.js new file mode 100644 index 0000000000..fccbbd331e --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-func-expression.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-func-expression.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + + ... + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +while (await function() {}) { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-identifier.js b/test/language/module-code/top-level-await/syntax/while-await-expr-identifier.js new file mode 100644 index 0000000000..4e8393ac48 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-identifier.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-identifier.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression IdentifierReference (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +var foo = 1; + + +while (await foo) { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-literal-number.js b/test/language/module-code/top-level-await/syntax/while-await-expr-literal-number.js new file mode 100644 index 0000000000..21f409fbb5 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-literal-number.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-number.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression NumberLiteral (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +while (await 1) { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-literal-string.js b/test/language/module-code/top-level-await/syntax/while-await-expr-literal-string.js new file mode 100644 index 0000000000..4705af699b --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-literal-string.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-literal-string.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression StringLiteral (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +while (await '') { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-nested.js b/test/language/module-code/top-level-await/syntax/while-await-expr-nested.js new file mode 100644 index 0000000000..65edaa4391 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-nested.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-nested.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: Nested AwaitExpressions (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + 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] + + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression[+In, ?Yield, ?Await]; + +---*/ + + +while (await await await await await await await await await await await await await await await 'await') { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-new-expr.js b/test/language/module-code/top-level-await/syntax/while-await-expr-new-expr.js new file mode 100644 index 0000000000..60032c3241 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-new-expr.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-new-expr.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression new MemberExpression (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + LeftHandSideExpression[Yield, Await]: + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] + + NewExpression[Yield, Await]: + MemberExpression[?Yield, ?Await] + new NewExpression[?Yield, ?Await] + + MemberExpression[Yield, Await]: + ... + new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +---*/ + + +while (await new Promise(function(res, rej) { res(1); })) { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-null.js b/test/language/module-code/top-level-await/syntax/while-await-expr-null.js new file mode 100644 index 0000000000..93cc14a6e8 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-null.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-null.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression NullLiteral (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +while (await null) { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-obj-literal.js b/test/language/module-code/top-level-await/syntax/while-await-expr-obj-literal.js new file mode 100644 index 0000000000..d4a00692c5 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-obj-literal.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-obj-literal.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression ObjectLiteral (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +while (await { function() {} }) { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-regexp.js b/test/language/module-code/top-level-await/syntax/while-await-expr-regexp.js new file mode 100644 index 0000000000..d988fd9306 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-regexp.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-regexp.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression RegularExpressionLiteral (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +while (await /1/) { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-template-literal.js b/test/language/module-code/top-level-await/syntax/while-await-expr-template-literal.js new file mode 100644 index 0000000000..7fb9e6d7f0 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-template-literal.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-template-literal.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression TemplateLiteral (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +while (await ``) { break; } diff --git a/test/language/module-code/top-level-await/syntax/while-await-expr-this.js b/test/language/module-code/top-level-await/syntax/while-await-expr-this.js new file mode 100644 index 0000000000..c38a91e149 --- /dev/null +++ b/test/language/module-code/top-level-await/syntax/while-await-expr-this.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/top-level-await/await-expr-this.case +// - src/top-level-await/syntax/while-expr.template +/*--- +description: AwaitExpression this (Valid syntax for top level await in an while expression position.) +esid: prod-AwaitExpression +features: [top-level-await] +flags: [generated, module] +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] + + ... + + + PrimaryExpression[Yield, Await]: + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ + + +while (await this) { break; }