diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/tests/test262/language/statementList | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/statementList')
82 files changed, 3821 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statementList/block-array-literal-with-item.js b/js/src/tests/test262/language/statementList/block-array-literal-with-item.js new file mode 100644 index 0000000000..5d302c8177 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-array-literal-with-item.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal-with-item.case +// - src/statementList/default/block.template +/*--- +description: Array Literal with items (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +{}[42];; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-array-literal.js b/js/src/tests/test262/language/statementList/block-array-literal.js new file mode 100644 index 0000000000..319377cea5 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-array-literal.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal.case +// - src/statementList/default/block.template +/*--- +description: Array Literal (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +{}[];; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-arrow-function-assignment-expr.js b/js/src/tests/test262/language/statementList/block-arrow-function-assignment-expr.js new file mode 100644 index 0000000000..ead2f79044 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-arrow-function-assignment-expr.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-assignment-expr.case +// - src/statementList/default/block.template +/*--- +description: Arrow Function with an AssignmentExpression (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +{}() => 42;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-arrow-function-functionbody.js b/js/src/tests/test262/language/statementList/block-arrow-function-functionbody.js new file mode 100644 index 0000000000..3870215d16 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-arrow-function-functionbody.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-functionbody.case +// - src/statementList/default/block.template +/*--- +description: Arrow Function with a Function Body (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +{}() => { return 42; };; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-block-with-labels.js b/js/src/tests/test262/language/statementList/block-block-with-labels.js new file mode 100644 index 0000000000..38fd845bfa --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-block-with-labels.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block-with-labels.case +// - src/statementList/default/block.template +/*--- +description: Block with a label (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +{}{x: 42};; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-block.js b/js/src/tests/test262/language/statementList/block-block.js new file mode 100644 index 0000000000..1c8433a5fd --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-block.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block.case +// - src/statementList/default/block.template +/*--- +description: Block (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +{}{}; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-expr-arrow-function-boolean-literal.js b/js/src/tests/test262/language/statementList/block-expr-arrow-function-boolean-literal.js new file mode 100644 index 0000000000..739221c0a9 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-expr-arrow-function-boolean-literal.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/expr-arrow-function-boolean-literal.case +// - src/statementList/default/block.template +/*--- +description: Expression with an Arrow Function and Boolean literal (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + Expression: + AssignmentExpression + Expression , AssignmentExpression + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +{}() => 1, 42;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-let-declaration.js b/js/src/tests/test262/language/statementList/block-let-declaration.js new file mode 100644 index 0000000000..45eb225e7a --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-let-declaration.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/let-declaration.case +// - src/statementList/default/block.template +/*--- +description: LexicalDeclaration using Let (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Declaration: + LexicalDeclaration + + LexicalDeclaration: + LetOrConst BindingList ; + + BindingList: + LexicalBinding + BindingList , LexicalBinding +---*/ + + +{}let a, b = 42, c;b;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-regexp-literal-flags.js b/js/src/tests/test262/language/statementList/block-regexp-literal-flags.js new file mode 100644 index 0000000000..3c13911cf6 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-regexp-literal-flags.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal-flags.case +// - src/statementList/default/block.template +/*--- +description: Regular Expression Literal with Flags (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +{}/1/g;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-regexp-literal.js b/js/src/tests/test262/language/statementList/block-regexp-literal.js new file mode 100644 index 0000000000..ca540bb0bb --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-regexp-literal.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal.case +// - src/statementList/default/block.template +/*--- +description: Regular Expression Literal (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +{}/1/;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-array-literal-with-item.js b/js/src/tests/test262/language/statementList/block-with-statment-array-literal-with-item.js new file mode 100644 index 0000000000..c8badc1879 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-array-literal-with-item.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal-with-item.case +// - src/statementList/default/block-with-statement.template +/*--- +description: Array Literal with items (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +// length is a label! +{length: 3000}[42];; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-array-literal.js b/js/src/tests/test262/language/statementList/block-with-statment-array-literal.js new file mode 100644 index 0000000000..38fa208363 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-array-literal.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal.case +// - src/statementList/default/block-with-statement.template +/*--- +description: Array Literal (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +// length is a label! +{length: 3000}[];; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-arrow-function-assignment-expr.js b/js/src/tests/test262/language/statementList/block-with-statment-arrow-function-assignment-expr.js new file mode 100644 index 0000000000..bda2b084be --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-arrow-function-assignment-expr.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-assignment-expr.case +// - src/statementList/default/block-with-statement.template +/*--- +description: Arrow Function with an AssignmentExpression (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +// length is a label! +{length: 3000}() => 42;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-arrow-function-functionbody.js b/js/src/tests/test262/language/statementList/block-with-statment-arrow-function-functionbody.js new file mode 100644 index 0000000000..7c8401502f --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-arrow-function-functionbody.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-functionbody.case +// - src/statementList/default/block-with-statement.template +/*--- +description: Arrow Function with a Function Body (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +// length is a label! +{length: 3000}() => { return 42; };; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-block-with-labels.js b/js/src/tests/test262/language/statementList/block-with-statment-block-with-labels.js new file mode 100644 index 0000000000..acf239f084 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-block-with-labels.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block-with-labels.case +// - src/statementList/default/block-with-statement.template +/*--- +description: Block with a label (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +// length is a label! +{length: 3000}{x: 42};; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-block.js b/js/src/tests/test262/language/statementList/block-with-statment-block.js new file mode 100644 index 0000000000..ed99a2c0ae --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-block.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block.case +// - src/statementList/default/block-with-statement.template +/*--- +description: Block (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +// length is a label! +{length: 3000}{}; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-expr-arrow-function-boolean-literal.js b/js/src/tests/test262/language/statementList/block-with-statment-expr-arrow-function-boolean-literal.js new file mode 100644 index 0000000000..c342f95e14 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-expr-arrow-function-boolean-literal.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/expr-arrow-function-boolean-literal.case +// - src/statementList/default/block-with-statement.template +/*--- +description: Expression with an Arrow Function and Boolean literal (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + Expression: + AssignmentExpression + Expression , AssignmentExpression + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +// length is a label! +{length: 3000}() => 1, 42;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-let-declaration.js b/js/src/tests/test262/language/statementList/block-with-statment-let-declaration.js new file mode 100644 index 0000000000..f8240aa52f --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-let-declaration.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/let-declaration.case +// - src/statementList/default/block-with-statement.template +/*--- +description: LexicalDeclaration using Let (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Declaration: + LexicalDeclaration + + LexicalDeclaration: + LetOrConst BindingList ; + + BindingList: + LexicalBinding + BindingList , LexicalBinding +---*/ + + +// length is a label! +{length: 3000}let a, b = 42, c;b;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-regexp-literal-flags.js b/js/src/tests/test262/language/statementList/block-with-statment-regexp-literal-flags.js new file mode 100644 index 0000000000..b7d6e7aa53 --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-regexp-literal-flags.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal-flags.case +// - src/statementList/default/block-with-statement.template +/*--- +description: Regular Expression Literal with Flags (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +// length is a label! +{length: 3000}/1/g;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/block-with-statment-regexp-literal.js b/js/src/tests/test262/language/statementList/block-with-statment-regexp-literal.js new file mode 100644 index 0000000000..caddfc8acd --- /dev/null +++ b/js/src/tests/test262/language/statementList/block-with-statment-regexp-literal.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal.case +// - src/statementList/default/block-with-statement.template +/*--- +description: Regular Expression Literal (Valid syntax of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +// length is a label! +{length: 3000}/1/;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/browser.js b/js/src/tests/test262/language/statementList/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statementList/browser.js diff --git a/js/src/tests/test262/language/statementList/class-array-literal-with-item.js b/js/src/tests/test262/language/statementList/class-array-literal-with-item.js new file mode 100644 index 0000000000..1fb4ab6e4e --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-array-literal-with-item.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal-with-item.case +// - src/statementList/default/class-declaration.template +/*--- +description: Array Literal with items (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +class C {}[42];; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/class-array-literal.js b/js/src/tests/test262/language/statementList/class-array-literal.js new file mode 100644 index 0000000000..525cb82af2 --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-array-literal.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal.case +// - src/statementList/default/class-declaration.template +/*--- +description: Array Literal (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +class C {}[];; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/class-arrow-function-assignment-expr.js b/js/src/tests/test262/language/statementList/class-arrow-function-assignment-expr.js new file mode 100644 index 0000000000..2b15a6f49a --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-arrow-function-assignment-expr.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-assignment-expr.case +// - src/statementList/default/class-declaration.template +/*--- +description: Arrow Function with an AssignmentExpression (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [arrow-function, class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +class C {}() => 42;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/class-arrow-function-functionbody.js b/js/src/tests/test262/language/statementList/class-arrow-function-functionbody.js new file mode 100644 index 0000000000..de5a4b56b9 --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-arrow-function-functionbody.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-functionbody.case +// - src/statementList/default/class-declaration.template +/*--- +description: Arrow Function with a Function Body (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [arrow-function, class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +class C {}() => { return 42; };; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/class-block-with-labels.js b/js/src/tests/test262/language/statementList/class-block-with-labels.js new file mode 100644 index 0000000000..466c3131c0 --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-block-with-labels.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block-with-labels.case +// - src/statementList/default/class-declaration.template +/*--- +description: Block with a label (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +class C {}{x: 42};; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/class-block.js b/js/src/tests/test262/language/statementList/class-block.js new file mode 100644 index 0000000000..82b7faba16 --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-block.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block.case +// - src/statementList/default/class-declaration.template +/*--- +description: Block (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +class C {}{}; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/class-expr-arrow-function-boolean-literal.js b/js/src/tests/test262/language/statementList/class-expr-arrow-function-boolean-literal.js new file mode 100644 index 0000000000..8e08f7d29e --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-expr-arrow-function-boolean-literal.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/expr-arrow-function-boolean-literal.case +// - src/statementList/default/class-declaration.template +/*--- +description: Expression with an Arrow Function and Boolean literal (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [arrow-function, class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + Expression: + AssignmentExpression + Expression , AssignmentExpression + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +class C {}() => 1, 42;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/class-let-declaration.js b/js/src/tests/test262/language/statementList/class-let-declaration.js new file mode 100644 index 0000000000..48fdc54e4b --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-let-declaration.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/let-declaration.case +// - src/statementList/default/class-declaration.template +/*--- +description: LexicalDeclaration using Let (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Declaration: + LexicalDeclaration + + LexicalDeclaration: + LetOrConst BindingList ; + + BindingList: + LexicalBinding + BindingList , LexicalBinding +---*/ + + +class C {}let a, b = 42, c;b;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/class-regexp-literal-flags.js b/js/src/tests/test262/language/statementList/class-regexp-literal-flags.js new file mode 100644 index 0000000000..080ec308b5 --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-regexp-literal-flags.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal-flags.case +// - src/statementList/default/class-declaration.template +/*--- +description: Regular Expression Literal with Flags (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +class C {}/1/g;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/class-regexp-literal.js b/js/src/tests/test262/language/statementList/class-regexp-literal.js new file mode 100644 index 0000000000..c0e658bb19 --- /dev/null +++ b/js/src/tests/test262/language/statementList/class-regexp-literal.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal.case +// - src/statementList/default/class-declaration.template +/*--- +description: Regular Expression Literal (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +class C {}/1/;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-array-literal-with-item.js b/js/src/tests/test262/language/statementList/eval-block-array-literal-with-item.js new file mode 100644 index 0000000000..43a5a879c4 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-array-literal-with-item.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal-with-item.case +// - src/statementList/default/eval-block.template +/*--- +description: Array Literal with items (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +var result = eval('{}[42];'); + +assert.sameValue(Object.getPrototypeOf(result), Array.prototype); +assert.sameValue(result.length, 1); +assert.sameValue(result[0], 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-array-literal.js b/js/src/tests/test262/language/statementList/eval-block-array-literal.js new file mode 100644 index 0000000000..fa02756b49 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-array-literal.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal.case +// - src/statementList/default/eval-block.template +/*--- +description: Array Literal (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +var result = eval('{}[];'); + +assert.sameValue(Object.getPrototypeOf(result), Array.prototype); +assert.sameValue(result.length, 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-arrow-function-assignment-expr.js b/js/src/tests/test262/language/statementList/eval-block-arrow-function-assignment-expr.js new file mode 100644 index 0000000000..4e747c3af3 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-arrow-function-assignment-expr.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-assignment-expr.case +// - src/statementList/default/eval-block.template +/*--- +description: Arrow Function with an AssignmentExpression (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +var result = eval('{}() => 42;'); + +assert.sameValue(result(), 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-arrow-function-functionbody.js b/js/src/tests/test262/language/statementList/eval-block-arrow-function-functionbody.js new file mode 100644 index 0000000000..de83704b74 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-arrow-function-functionbody.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-functionbody.case +// - src/statementList/default/eval-block.template +/*--- +description: Arrow Function with a Function Body (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +var result = eval('{}() => { return 42; };'); + +assert.sameValue(result(), 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-block-with-labels.js b/js/src/tests/test262/language/statementList/eval-block-block-with-labels.js new file mode 100644 index 0000000000..98014d2e36 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-block-with-labels.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block-with-labels.case +// - src/statementList/default/eval-block.template +/*--- +description: Block with a label (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +var result = eval('{}{x: 42};'); + +assert.sameValue(result, 42, 'it does not evaluate to an Object with the property x'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-block.js b/js/src/tests/test262/language/statementList/eval-block-block.js new file mode 100644 index 0000000000..2ffc5874ec --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-block.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block.case +// - src/statementList/default/eval-block.template +/*--- +description: Block (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +var result = eval('{}{}'); + +assert.sameValue(result, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-expr-arrow-function-boolean-literal.js b/js/src/tests/test262/language/statementList/eval-block-expr-arrow-function-boolean-literal.js new file mode 100644 index 0000000000..e95b33aee5 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-expr-arrow-function-boolean-literal.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/expr-arrow-function-boolean-literal.case +// - src/statementList/default/eval-block.template +/*--- +description: Expression with an Arrow Function and Boolean literal (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + Expression: + AssignmentExpression + Expression , AssignmentExpression + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +var result = eval('{}() => 1, 42;'); + +assert.sameValue(result, 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-let-declaration.js b/js/src/tests/test262/language/statementList/eval-block-let-declaration.js new file mode 100644 index 0000000000..ae4ffb7207 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-let-declaration.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/let-declaration.case +// - src/statementList/default/eval-block.template +/*--- +description: LexicalDeclaration using Let (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Declaration: + LexicalDeclaration + + LexicalDeclaration: + LetOrConst BindingList ; + + BindingList: + LexicalBinding + BindingList , LexicalBinding +---*/ + + +var result = eval('{}let a, b = 42, c;b;'); + +assert.sameValue(result, 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-regexp-literal-flags.js b/js/src/tests/test262/language/statementList/eval-block-regexp-literal-flags.js new file mode 100644 index 0000000000..c563d68aac --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-regexp-literal-flags.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal-flags.case +// - src/statementList/default/eval-block.template +/*--- +description: Regular Expression Literal with Flags (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +var result = eval('{}/1/g;'); + +assert.sameValue(Object.getPrototypeOf(result), RegExp.prototype); +assert.sameValue(result.flags, 'g'); +assert.sameValue(result.toString(), '/1/g'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-regexp-literal.js b/js/src/tests/test262/language/statementList/eval-block-regexp-literal.js new file mode 100644 index 0000000000..e1d82e589b --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-regexp-literal.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal.case +// - src/statementList/default/eval-block.template +/*--- +description: Regular Expression Literal (Eval production of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +var result = eval('{}/1/;'); + +assert.sameValue(Object.getPrototypeOf(result), RegExp.prototype); +assert.sameValue(result.flags, ''); +assert.sameValue(result.toString(), '/1/'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-array-literal-with-item.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-array-literal-with-item.js new file mode 100644 index 0000000000..af18bc0bf6 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-array-literal-with-item.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal-with-item.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: Array Literal with items (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +// length is a label! +var result = eval('{length: 3000}[42];;'); + +// Reuse this value for items with empty completions +var expected = 3000; + + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-array-literal.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-array-literal.js new file mode 100644 index 0000000000..acf26d1435 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-array-literal.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: Array Literal (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +// length is a label! +var result = eval('{length: 3000}[];;'); + +// Reuse this value for items with empty completions +var expected = 3000; + + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-arrow-function-assignment-expr.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-arrow-function-assignment-expr.js new file mode 100644 index 0000000000..28166541e0 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-arrow-function-assignment-expr.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-assignment-expr.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: Arrow Function with an AssignmentExpression (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +// length is a label! +var result = eval('{length: 3000}() => 42;;'); + +// Reuse this value for items with empty completions +var expected = 3000; + + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-arrow-function-functionbody.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-arrow-function-functionbody.js new file mode 100644 index 0000000000..307813ff99 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-arrow-function-functionbody.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-functionbody.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: Arrow Function with a Function Body (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +// length is a label! +var result = eval('{length: 3000}() => { return 42; };;'); + +// Reuse this value for items with empty completions +var expected = 3000; + + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-block-with-labels.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-block-with-labels.js new file mode 100644 index 0000000000..9362d809ef --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-block-with-labels.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block-with-labels.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: Block with a label (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +// length is a label! +var result = eval('{length: 3000}{x: 42};;'); + +// Reuse this value for items with empty completions +var expected = 3000; + + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-block.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-block.js new file mode 100644 index 0000000000..2a0d2f4944 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-block.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: Block (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +// length is a label! +var result = eval('{length: 3000}{};'); + +// Reuse this value for items with empty completions +var expected = 3000; + +assert.sameValue(result, expected); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-expr-arrow-function-boolean-literal.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-expr-arrow-function-boolean-literal.js new file mode 100644 index 0000000000..cb4a37681a --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-expr-arrow-function-boolean-literal.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/expr-arrow-function-boolean-literal.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: Expression with an Arrow Function and Boolean literal (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + Expression: + AssignmentExpression + Expression , AssignmentExpression + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +// length is a label! +var result = eval('{length: 3000}() => 1, 42;;'); + +// Reuse this value for items with empty completions +var expected = 3000; + + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-let-declaration.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-let-declaration.js new file mode 100644 index 0000000000..d76a6fbaa9 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-let-declaration.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/let-declaration.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: LexicalDeclaration using Let (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Declaration: + LexicalDeclaration + + LexicalDeclaration: + LetOrConst BindingList ; + + BindingList: + LexicalBinding + BindingList , LexicalBinding +---*/ + + +// length is a label! +var result = eval('{length: 3000}let a, b = 42, c;b;;'); + +// Reuse this value for items with empty completions +var expected = 3000; + + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-regexp-literal-flags.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-regexp-literal-flags.js new file mode 100644 index 0000000000..74f207570d --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-regexp-literal-flags.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal-flags.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: Regular Expression Literal with Flags (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +// length is a label! +var result = eval('{length: 3000}/1/g;;'); + +// Reuse this value for items with empty completions +var expected = 3000; + + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-block-with-statment-regexp-literal.js b/js/src/tests/test262/language/statementList/eval-block-with-statment-regexp-literal.js new file mode 100644 index 0000000000..bc7aaeccca --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-block-with-statment-regexp-literal.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal.case +// - src/statementList/default/eval-block-with-statement.template +/*--- +description: Regular Expression Literal (Evaluate produciton of StatementList starting with a BlockStatement) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Statement: + BlockStatement + + BlockStatement: + Block + + Block: + { StatementList_opt } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +// length is a label! +var result = eval('{length: 3000}/1/;;'); + +// Reuse this value for items with empty completions +var expected = 3000; + + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-array-literal-with-item.js b/js/src/tests/test262/language/statementList/eval-class-array-literal-with-item.js new file mode 100644 index 0000000000..b05d921ccf --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-array-literal-with-item.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal-with-item.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: Array Literal with items (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +var result = eval('class C {}[42];;'); + +assert.sameValue(Object.getPrototypeOf(result), Array.prototype); +assert.sameValue(result.length, 1); +assert.sameValue(result[0], 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-array-literal.js b/js/src/tests/test262/language/statementList/eval-class-array-literal.js new file mode 100644 index 0000000000..52eb55be21 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-array-literal.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: Array Literal (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +var result = eval('class C {}[];;'); + +assert.sameValue(Object.getPrototypeOf(result), Array.prototype); +assert.sameValue(result.length, 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-arrow-function-assignment-expr.js b/js/src/tests/test262/language/statementList/eval-class-arrow-function-assignment-expr.js new file mode 100644 index 0000000000..b4eaa74abc --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-arrow-function-assignment-expr.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-assignment-expr.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: Arrow Function with an AssignmentExpression (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [arrow-function, class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +var result = eval('class C {}() => 42;;'); + +assert.sameValue(result(), 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-arrow-function-functionbody.js b/js/src/tests/test262/language/statementList/eval-class-arrow-function-functionbody.js new file mode 100644 index 0000000000..4b0db1eaf9 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-arrow-function-functionbody.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-functionbody.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: Arrow Function with a Function Body (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [arrow-function, class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +var result = eval('class C {}() => { return 42; };;'); + +assert.sameValue(result(), 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-block-with-labels.js b/js/src/tests/test262/language/statementList/eval-class-block-with-labels.js new file mode 100644 index 0000000000..0e6562f0d5 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-block-with-labels.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block-with-labels.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: Block with a label (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +var result = eval('class C {}{x: 42};;'); + +assert.sameValue(result, 42, 'it does not evaluate to an Object with the property x'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-block.js b/js/src/tests/test262/language/statementList/eval-class-block.js new file mode 100644 index 0000000000..58e54d65da --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-block.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: Block (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +var result = eval('class C {}{};'); + +assert.sameValue(result, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-expr-arrow-function-boolean-literal.js b/js/src/tests/test262/language/statementList/eval-class-expr-arrow-function-boolean-literal.js new file mode 100644 index 0000000000..6e417c7370 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-expr-arrow-function-boolean-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/expr-arrow-function-boolean-literal.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: Expression with an Arrow Function and Boolean literal (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [arrow-function, class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + Expression: + AssignmentExpression + Expression , AssignmentExpression + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +var result = eval('class C {}() => 1, 42;;'); + +assert.sameValue(result, 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-let-declaration.js b/js/src/tests/test262/language/statementList/eval-class-let-declaration.js new file mode 100644 index 0000000000..fc840d03be --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-let-declaration.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/let-declaration.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: LexicalDeclaration using Let (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Declaration: + LexicalDeclaration + + LexicalDeclaration: + LetOrConst BindingList ; + + BindingList: + LexicalBinding + BindingList , LexicalBinding +---*/ + + +var result = eval('class C {}let a, b = 42, c;b;;'); + +assert.sameValue(result, 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-regexp-literal-flags.js b/js/src/tests/test262/language/statementList/eval-class-regexp-literal-flags.js new file mode 100644 index 0000000000..8851bc147c --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-regexp-literal-flags.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal-flags.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: Regular Expression Literal with Flags (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +var result = eval('class C {}/1/g;;'); + +assert.sameValue(Object.getPrototypeOf(result), RegExp.prototype); +assert.sameValue(result.flags, 'g'); +assert.sameValue(result.toString(), '/1/g'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-class-regexp-literal.js b/js/src/tests/test262/language/statementList/eval-class-regexp-literal.js new file mode 100644 index 0000000000..c09dd4210f --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-class-regexp-literal.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal.case +// - src/statementList/default/eval-class-declaration.template +/*--- +description: Regular Expression Literal (Valid syntax of StatementList starting with a Class Declaration) +esid: prod-StatementList +features: [class] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + ClassDeclaration + + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +var result = eval('class C {}/1/;;'); + +assert.sameValue(Object.getPrototypeOf(result), RegExp.prototype); +assert.sameValue(result.flags, ''); +assert.sameValue(result.toString(), '/1/'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-array-literal-with-item.js b/js/src/tests/test262/language/statementList/eval-fn-array-literal-with-item.js new file mode 100644 index 0000000000..b4524fae11 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-array-literal-with-item.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal-with-item.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: Array Literal with items (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +var result = eval('function fn() {}[42];;'); + +assert.sameValue(Object.getPrototypeOf(result), Array.prototype); +assert.sameValue(result.length, 1); +assert.sameValue(result[0], 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-array-literal.js b/js/src/tests/test262/language/statementList/eval-fn-array-literal.js new file mode 100644 index 0000000000..7430098bb9 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-array-literal.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: Array Literal (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +var result = eval('function fn() {}[];;'); + +assert.sameValue(Object.getPrototypeOf(result), Array.prototype); +assert.sameValue(result.length, 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-arrow-function-assignment-expr.js b/js/src/tests/test262/language/statementList/eval-fn-arrow-function-assignment-expr.js new file mode 100644 index 0000000000..4e73b4d381 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-arrow-function-assignment-expr.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-assignment-expr.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: Arrow Function with an AssignmentExpression (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +var result = eval('function fn() {}() => 42;;'); + +assert.sameValue(result(), 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-arrow-function-functionbody.js b/js/src/tests/test262/language/statementList/eval-fn-arrow-function-functionbody.js new file mode 100644 index 0000000000..eb0ac8ce86 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-arrow-function-functionbody.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-functionbody.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: Arrow Function with a Function Body (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +var result = eval('function fn() {}() => { return 42; };;'); + +assert.sameValue(result(), 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-block-with-labels.js b/js/src/tests/test262/language/statementList/eval-fn-block-with-labels.js new file mode 100644 index 0000000000..93f9016452 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-block-with-labels.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block-with-labels.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: Block with a label (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +var result = eval('function fn() {}{x: 42};;'); + +assert.sameValue(result, 42, 'it does not evaluate to an Object with the property x'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-block.js b/js/src/tests/test262/language/statementList/eval-fn-block.js new file mode 100644 index 0000000000..5b4816d8e7 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-block.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: Block (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +var result = eval('function fn() {}{};'); + +assert.sameValue(result, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-expr-arrow-function-boolean-literal.js b/js/src/tests/test262/language/statementList/eval-fn-expr-arrow-function-boolean-literal.js new file mode 100644 index 0000000000..5c769792bc --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-expr-arrow-function-boolean-literal.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/expr-arrow-function-boolean-literal.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: Expression with an Arrow Function and Boolean literal (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + Expression: + AssignmentExpression + Expression , AssignmentExpression + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +var result = eval('function fn() {}() => 1, 42;;'); + +assert.sameValue(result, 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-let-declaration.js b/js/src/tests/test262/language/statementList/eval-fn-let-declaration.js new file mode 100644 index 0000000000..b5c6dc99a7 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-let-declaration.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/let-declaration.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: LexicalDeclaration using Let (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Declaration: + LexicalDeclaration + + LexicalDeclaration: + LetOrConst BindingList ; + + BindingList: + LexicalBinding + BindingList , LexicalBinding +---*/ + + +var result = eval('function fn() {}let a, b = 42, c;b;;'); + +assert.sameValue(result, 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-regexp-literal-flags.js b/js/src/tests/test262/language/statementList/eval-fn-regexp-literal-flags.js new file mode 100644 index 0000000000..5ff481b4ee --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-regexp-literal-flags.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal-flags.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: Regular Expression Literal with Flags (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +var result = eval('function fn() {}/1/g;;'); + +assert.sameValue(Object.getPrototypeOf(result), RegExp.prototype); +assert.sameValue(result.flags, 'g'); +assert.sameValue(result.toString(), '/1/g'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/eval-fn-regexp-literal.js b/js/src/tests/test262/language/statementList/eval-fn-regexp-literal.js new file mode 100644 index 0000000000..a7280b4107 --- /dev/null +++ b/js/src/tests/test262/language/statementList/eval-fn-regexp-literal.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal.case +// - src/statementList/default/eval-function-declaration.template +/*--- +description: Regular Expression Literal (Eval production of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +var result = eval('function fn() {}/1/;;'); + +assert.sameValue(Object.getPrototypeOf(result), RegExp.prototype); +assert.sameValue(result.flags, ''); +assert.sameValue(result.toString(), '/1/'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-array-literal-with-item.js b/js/src/tests/test262/language/statementList/fn-array-literal-with-item.js new file mode 100644 index 0000000000..b5e0b5999b --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-array-literal-with-item.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal-with-item.case +// - src/statementList/default/function-declaration.template +/*--- +description: Array Literal with items (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +function fn() {}[42];; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-array-literal.js b/js/src/tests/test262/language/statementList/fn-array-literal.js new file mode 100644 index 0000000000..e5ab5b2364 --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-array-literal.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/array-literal.case +// - src/statementList/default/function-declaration.template +/*--- +description: Array Literal (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ArrayLiteral[Yield, Await]: + [ Elision_opt ] + [ ElementList ] + [ ElementList , Elision_opt ] +---*/ + + +function fn() {}[];; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-arrow-function-assignment-expr.js b/js/src/tests/test262/language/statementList/fn-arrow-function-assignment-expr.js new file mode 100644 index 0000000000..56e8c27d58 --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-arrow-function-assignment-expr.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-assignment-expr.case +// - src/statementList/default/function-declaration.template +/*--- +description: Arrow Function with an AssignmentExpression (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +function fn() {}() => 42;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-arrow-function-functionbody.js b/js/src/tests/test262/language/statementList/fn-arrow-function-functionbody.js new file mode 100644 index 0000000000..ad78d2ac99 --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-arrow-function-functionbody.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/arrow-function-functionbody.case +// - src/statementList/default/function-declaration.template +/*--- +description: Arrow Function with a Function Body (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + ... + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +function fn() {}() => { return 42; };; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-block-with-labels.js b/js/src/tests/test262/language/statementList/fn-block-with-labels.js new file mode 100644 index 0000000000..a092a5ce9c --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-block-with-labels.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block-with-labels.case +// - src/statementList/default/function-declaration.template +/*--- +description: Block with a label (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +function fn() {}{x: 42};; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-block.js b/js/src/tests/test262/language/statementList/fn-block.js new file mode 100644 index 0000000000..db524f09e3 --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-block.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/block.case +// - src/statementList/default/function-declaration.template +/*--- +description: Block (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + // lookahead here prevents capturing an Object literal + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; +---*/ + + +function fn() {}{}; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-expr-arrow-function-boolean-literal.js b/js/src/tests/test262/language/statementList/fn-expr-arrow-function-boolean-literal.js new file mode 100644 index 0000000000..16851c0e2c --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-expr-arrow-function-boolean-literal.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/expr-arrow-function-boolean-literal.case +// - src/statementList/default/function-declaration.template +/*--- +description: Expression with an Arrow Function and Boolean literal (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +features: [arrow-function] +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + Expression: + AssignmentExpression + Expression , AssignmentExpression + + AssignmentExpression: + ConditionalExpression + [+Yield]YieldExpression + ArrowFunction + + ArrowFunction: + ArrowParameters [no LineTerminator here] => ConciseBody + + ConciseBody: + [lookahead ≠ {] AssignmentExpression + { FunctionBody } + +---*/ + + +function fn() {}() => 1, 42;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-let-declaration.js b/js/src/tests/test262/language/statementList/fn-let-declaration.js new file mode 100644 index 0000000000..87ae5dad02 --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-let-declaration.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/let-declaration.case +// - src/statementList/default/function-declaration.template +/*--- +description: LexicalDeclaration using Let (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Declaration: + LexicalDeclaration + + LexicalDeclaration: + LetOrConst BindingList ; + + BindingList: + LexicalBinding + BindingList , LexicalBinding +---*/ + + +function fn() {}let a, b = 42, c;b;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-regexp-literal-flags.js b/js/src/tests/test262/language/statementList/fn-regexp-literal-flags.js new file mode 100644 index 0000000000..2ea71b4772 --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-regexp-literal-flags.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal-flags.case +// - src/statementList/default/function-declaration.template +/*--- +description: Regular Expression Literal with Flags (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +function fn() {}/1/g;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/fn-regexp-literal.js b/js/src/tests/test262/language/statementList/fn-regexp-literal.js new file mode 100644 index 0000000000..84f3b62e15 --- /dev/null +++ b/js/src/tests/test262/language/statementList/fn-regexp-literal.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/statementList/regexp-literal.case +// - src/statementList/default/function-declaration.template +/*--- +description: Regular Expression Literal (Valid syntax of StatementList starting with a Function Declaration) +esid: prod-StatementList +flags: [generated] +info: | + StatementList: + StatementListItem + StatementList StatementListItem + + StatementListItem: + Statement + Declaration + + Declaration: + HoistableDeclaration + + FunctionDeclaration: + function BindingIdentifier ( FormalParameters ) { FunctionBody } + + Statement: + BlockStatement + VariableStatement + EmptyStatement + ExpressionStatement + ... + + ExpressionStatement[Yield, Await]: + [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] + Expression ; + + RegularExpressionLiteral :: + / RegularExpressionBody / RegularExpressionFlags +---*/ + + +function fn() {}/1/;; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statementList/shell.js b/js/src/tests/test262/language/statementList/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statementList/shell.js |