diff options
Diffstat (limited to 'js/src/tests/test262/language/statements/class/decorator/syntax/valid')
13 files changed, 707 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/browser.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/browser.js diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-call-expr-identifier-reference.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-call-expr-identifier-reference.js new file mode 100644 index 0000000000..b50802ba42 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-call-expr-identifier-reference.js @@ -0,0 +1,88 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-call-expr-identifier-reference.case +// - src/decorator/syntax/valid/cls-element-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorCallExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated] +info: | + ClassElement[Yield, Await] : + DecoratorList[?Yield, ?Await]opt MethodDefinition[?Yield, ?Await] + DecoratorList[?Yield, ?Await]opt static MethodDefinition[?Yield, ?Await] + DecoratorList[?Yield, ?Await]opt FieldDefinition[?Yield, ?Await] ; + DecoratorList[?Yield, ?Await]opt static FieldDefinition[?Yield, ?Await] ; + ClassStaticBlock + ; + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + DecoratorCallExpression[Yield, Await] : + DecoratorMemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + + DecoratorMemberExpression[Yield, Await] : + IdentifierReference[?Yield, ?Await] + PrivateIdentifier + DecoratorMemberExpression[?Yield, ?Await] . IdentifierName + + IdentifierReference[Yield, Await] : + Identifier + [~Yield] yield + [~Await] await + +---*/ +function decorator() { + return () => {}; +} +var $ = decorator; +var _ = decorator; +var \u{6F} = decorator; +var \u2118 = decorator; +var ZW_\u200C_NJ = decorator; +var ZW_\u200D_J = decorator; +var await = decorator; + + + +class C { + @$() + @_() + @\u{6F}() + @\u2118() + @ZW_\u200C_NJ() + @ZW_\u200D_J() + @await() method() {} + @$() + @_() + @\u{6F}() + @\u2118() + @ZW_\u200C_NJ() + @ZW_\u200D_J() + @await() static method() {} + @$() + @_() + @\u{6F}() + @\u2118() + @ZW_\u200C_NJ() + @ZW_\u200D_J() + @await() field; + @$() + @_() + @\u{6F}() + @\u2118() + @ZW_\u200C_NJ() + @ZW_\u200D_J() + @await() static field; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-member-expr-decorator-member-expr.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-member-expr-decorator-member-expr.js new file mode 100644 index 0000000000..38db55bc84 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-member-expr-decorator-member-expr.js @@ -0,0 +1,84 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-member-expr-decorator-member-expr.case +// - src/decorator/syntax/valid/cls-element-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorMemberExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated] +info: | + ClassElement[Yield, Await] : + DecoratorList[?Yield, ?Await]opt MethodDefinition[?Yield, ?Await] + DecoratorList[?Yield, ?Await]opt static MethodDefinition[?Yield, ?Await] + DecoratorList[?Yield, ?Await]opt FieldDefinition[?Yield, ?Await] ; + DecoratorList[?Yield, ?Await]opt static FieldDefinition[?Yield, ?Await] ; + ClassStaticBlock + ; + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + DecoratorMemberExpression[Yield, Await] : + IdentifierReference[?Yield, ?Await] + PrivateIdentifier + DecoratorMemberExpression[?Yield, ?Await] . IdentifierName + +---*/ +let ns = { + $() {}, + _() {}, + \u{6F}() {}, + \u2118() {}, + ZW_\u200C_NJ() {}, + ZW_\u200D_J() {}, + yield() {}, + await() {}, +} + + + +class C { + @ns.$ + @ns._ + @ns.\u{6F} + @ns.\u2118 + @ns.ZW_\u200C_NJ + @ns.ZW_\u200D_J + @ns.yield + @ns.await method() {} + @ns.$ + @ns._ + @ns.\u{6F} + @ns.\u2118 + @ns.ZW_\u200C_NJ + @ns.ZW_\u200D_J + @ns.yield + @ns.await static method() {} + @ns.$ + @ns._ + @ns.\u{6F} + @ns.\u2118 + @ns.ZW_\u200C_NJ + @ns.ZW_\u200D_J + @ns.yield + @ns.await field; + @ns.$ + @ns._ + @ns.\u{6F} + @ns.\u2118 + @ns.ZW_\u200C_NJ + @ns.ZW_\u200D_J + @ns.yield + @ns.await static field; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-member-expr-identifier-reference.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-member-expr-identifier-reference.js new file mode 100644 index 0000000000..468d3e2b2c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-member-expr-identifier-reference.js @@ -0,0 +1,77 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-member-expr-identifier-reference.case +// - src/decorator/syntax/valid/cls-element-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorMemberExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated] +info: | + ClassElement[Yield, Await] : + DecoratorList[?Yield, ?Await]opt MethodDefinition[?Yield, ?Await] + DecoratorList[?Yield, ?Await]opt static MethodDefinition[?Yield, ?Await] + DecoratorList[?Yield, ?Await]opt FieldDefinition[?Yield, ?Await] ; + DecoratorList[?Yield, ?Await]opt static FieldDefinition[?Yield, ?Await] ; + ClassStaticBlock + ; + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + IdentifierReference[Yield, Await] : + Identifier + [~Yield] yield + [~Await] await + +---*/ +function $() {} +function _() {} +function \u{6F}() {} +function \u2118() {} +function ZW_\u200C_NJ() {} +function ZW_\u200D_J() {} +function await() {} + + + +class C { + @$ + @_ + @\u{6F} + @\u2118 + @ZW_\u200C_NJ + @ZW_\u200D_J + @await method() {} + @$ + @_ + @\u{6F} + @\u2118 + @ZW_\u200C_NJ + @ZW_\u200D_J + @await static method() {} + @$ + @_ + @\u{6F} + @\u2118 + @ZW_\u200C_NJ + @ZW_\u200D_J + @await field; + @$ + @_ + @\u{6F} + @\u2118 + @ZW_\u200C_NJ + @ZW_\u200D_J + @await static field; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-parenthesized-expr-identifier-reference.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-parenthesized-expr-identifier-reference.js new file mode 100644 index 0000000000..8acb98f1c4 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/class-element-decorator-parenthesized-expr-identifier-reference.js @@ -0,0 +1,90 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-parenthesized-expr-identifier-reference.case +// - src/decorator/syntax/valid/cls-element-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorParenthesizedExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated] +info: | + ClassElement[Yield, Await] : + DecoratorList[?Yield, ?Await]opt MethodDefinition[?Yield, ?Await] + DecoratorList[?Yield, ?Await]opt static MethodDefinition[?Yield, ?Await] + DecoratorList[?Yield, ?Await]opt FieldDefinition[?Yield, ?Await] ; + DecoratorList[?Yield, ?Await]opt static FieldDefinition[?Yield, ?Await] ; + ClassStaticBlock + ; + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + DecoratorParenthesizedExpression[Yield, Await] : + ( Expression[+In, ?Yield, ?Await] ) + + PrimaryExpression[Yield, Await] : + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +function $() {} +function _() {} +function \u{6F}() {} +function \u2118() {} +function ZW_\u200C_NJ() {} +function ZW_\u200D_J() {} +function await() {} + + + +class C { + @($) + @(_) + @(\u{6F}) + @(\u2118) + @(ZW_\u200C_NJ) + @(ZW_\u200D_J) + @(await) method() {} + @($) + @(_) + @(\u{6F}) + @(\u2118) + @(ZW_\u200C_NJ) + @(ZW_\u200D_J) + @(await) static method() {} + @($) + @(_) + @(\u{6F}) + @(\u2118) + @(ZW_\u200C_NJ) + @(ZW_\u200D_J) + @(await) field; + @($) + @(_) + @(\u{6F}) + @(\u2118) + @(ZW_\u200C_NJ) + @(ZW_\u200D_J) + @(await) static field; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-call-expr-identifier-reference-yield.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-call-expr-identifier-reference-yield.js new file mode 100644 index 0000000000..f86f894f1d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-call-expr-identifier-reference-yield.js @@ -0,0 +1,48 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-call-expr-identifier-reference-yield.case +// - src/decorator/syntax/valid/cls-decl-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorCallExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated, noStrict] +info: | + ClassDeclaration[Yield, Await, Default] : + DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] DecoratorList[?Yield, ?Await]opt class ClassTail[?Yield, ?Await] + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + DecoratorCallExpression[Yield, Await] : + DecoratorMemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + + DecoratorMemberExpression[Yield, Await] : + IdentifierReference[?Yield, ?Await] + PrivateIdentifier + DecoratorMemberExpression[?Yield, ?Await] . IdentifierName + + IdentifierReference[Yield, Await] : + [~Yield] yield + ... + +---*/ +function decorator() { + return () => {}; +} +var yield = decorator; + + + +@yield() class C {} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-call-expr-identifier-reference.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-call-expr-identifier-reference.js new file mode 100644 index 0000000000..217747833b --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-call-expr-identifier-reference.js @@ -0,0 +1,61 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-call-expr-identifier-reference.case +// - src/decorator/syntax/valid/cls-decl-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorCallExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated] +info: | + ClassDeclaration[Yield, Await, Default] : + DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] DecoratorList[?Yield, ?Await]opt class ClassTail[?Yield, ?Await] + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + DecoratorCallExpression[Yield, Await] : + DecoratorMemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + + DecoratorMemberExpression[Yield, Await] : + IdentifierReference[?Yield, ?Await] + PrivateIdentifier + DecoratorMemberExpression[?Yield, ?Await] . IdentifierName + + IdentifierReference[Yield, Await] : + Identifier + [~Yield] yield + [~Await] await + +---*/ +function decorator() { + return () => {}; +} +var $ = decorator; +var _ = decorator; +var \u{6F} = decorator; +var \u2118 = decorator; +var ZW_\u200C_NJ = decorator; +var ZW_\u200D_J = decorator; +var await = decorator; + + + +@$() +@_() +@\u{6F}() +@\u2118() +@ZW_\u200C_NJ() +@ZW_\u200D_J() +@await() class C {} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-member-expr-decorator-member-expr.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-member-expr-decorator-member-expr.js new file mode 100644 index 0000000000..ce38509819 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-member-expr-decorator-member-expr.js @@ -0,0 +1,54 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-member-expr-decorator-member-expr.case +// - src/decorator/syntax/valid/cls-decl-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorMemberExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated] +info: | + ClassDeclaration[Yield, Await, Default] : + DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] DecoratorList[?Yield, ?Await]opt class ClassTail[?Yield, ?Await] + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + DecoratorMemberExpression[Yield, Await] : + IdentifierReference[?Yield, ?Await] + PrivateIdentifier + DecoratorMemberExpression[?Yield, ?Await] . IdentifierName + +---*/ +let ns = { + $() {}, + _() {}, + \u{6F}() {}, + \u2118() {}, + ZW_\u200C_NJ() {}, + ZW_\u200D_J() {}, + yield() {}, + await() {}, +} + + + +@ns.$ +@ns._ +@ns.\u{6F} +@ns.\u2118 +@ns.ZW_\u200C_NJ +@ns.ZW_\u200D_J +@ns.yield +@ns.await class C {} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-member-expr-identifier-reference-yield.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-member-expr-identifier-reference-yield.js new file mode 100644 index 0000000000..216d97d4ab --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-member-expr-identifier-reference-yield.js @@ -0,0 +1,37 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-member-expr-identifier-reference-yield.case +// - src/decorator/syntax/valid/cls-decl-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorMemberExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated, noStrict] +info: | + ClassDeclaration[Yield, Await, Default] : + DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] DecoratorList[?Yield, ?Await]opt class ClassTail[?Yield, ?Await] + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + IdentifierReference[Yield, Await] : + [~Yield] yield + ... + +---*/ +function yield() {} + + + +@yield class C {} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-member-expr-identifier-reference.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-member-expr-identifier-reference.js new file mode 100644 index 0000000000..e77cec62dc --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-member-expr-identifier-reference.js @@ -0,0 +1,50 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-member-expr-identifier-reference.case +// - src/decorator/syntax/valid/cls-decl-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorMemberExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated] +info: | + ClassDeclaration[Yield, Await, Default] : + DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] DecoratorList[?Yield, ?Await]opt class ClassTail[?Yield, ?Await] + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + IdentifierReference[Yield, Await] : + Identifier + [~Yield] yield + [~Await] await + +---*/ +function $() {} +function _() {} +function \u{6F}() {} +function \u2118() {} +function ZW_\u200C_NJ() {} +function ZW_\u200D_J() {} +function await() {} + + + +@$ +@_ +@\u{6F} +@\u2118 +@ZW_\u200C_NJ +@ZW_\u200D_J +@await class C {} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference-yield.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference-yield.js new file mode 100644 index 0000000000..a8bdc2488a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference-yield.js @@ -0,0 +1,55 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-parenthesized-expr-identifier-reference-yield.case +// - src/decorator/syntax/valid/cls-decl-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorParenthesizedExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated, noStrict] +info: | + ClassDeclaration[Yield, Await, Default] : + DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] DecoratorList[?Yield, ?Await]opt class ClassTail[?Yield, ?Await] + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + DecoratorParenthesizedExpression[Yield, Await] : + ( Expression[+In, ?Yield, ?Await] ) + + PrimaryExpression[Yield, Await] : + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + + IdentifierReference[Yield, Await] : + [~Yield] yield + ... + +---*/ +function yield() {} + + + +@(yield) class C {} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference.js new file mode 100644 index 0000000000..709f352eea --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/decorator-parenthesized-expr-identifier-reference.js @@ -0,0 +1,63 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/decorator/decorator-parenthesized-expr-identifier-reference.case +// - src/decorator/syntax/valid/cls-decl-decorators-valid-syntax.template +/*--- +description: Decorator @ DecoratorParenthesizedExpression (Valid syntax for decorator on class.) +esid: prod-ClassDeclaration +features: [class, decorators] +flags: [generated] +info: | + ClassDeclaration[Yield, Await, Default] : + DecoratorList[?Yield, ?Await]opt class BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] DecoratorList[?Yield, ?Await]opt class ClassTail[?Yield, ?Await] + + DecoratorList[Yield, Await] : + DecoratorList[?Yield, ?Await]opt Decorator[?Yield, ?Await] + + Decorator[Yield, Await] : + @ DecoratorMemberExpression[?Yield, ?Await] + @ DecoratorParenthesizedExpression[?Yield, ?Await] + @ DecoratorCallExpression[?Yield, ?Await] + + ... + + + DecoratorParenthesizedExpression[Yield, Await] : + ( Expression[+In, ?Yield, ?Await] ) + + PrimaryExpression[Yield, Await] : + this + IdentifierReference[?Yield, ?Await] + Literal + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] + FunctionExpression + ClassExpression[?Yield, ?Await] + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral[?Yield, ?Await, ~Tagged] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] + +---*/ +function $() {} +function _() {} +function \u{6F}() {} +function \u2118() {} +function ZW_\u200C_NJ() {} +function ZW_\u200D_J() {} +function await() {} + + + +@($) +@(_) +@(\u{6F}) +@(\u2118) +@(ZW_\u200C_NJ) +@(ZW_\u200D_J) +@(await) class C {} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/decorator/syntax/valid/shell.js b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/decorator/syntax/valid/shell.js |