From 517ada709ca47f315055dcf7c215bb1a4ca4611b Mon Sep 17 00:00:00 2001 From: Cristian Tuns Date: Tue, 16 Aug 2022 09:26:43 -0400 Subject: [PATCH] Backed out 4 changesets (bug 1783738) for causing reftest failures with getBuildConfiguration CLOSED TREE Backed out changeset a10f3d51daad (bug 1783738) Backed out changeset 6cd01666a991 (bug 1783738) Backed out changeset 9d7f488a2cd9 (bug 1783738) Backed out changeset 3ca5e3471c04 (bug 1783738) --- js/public/friend/ErrorNumbers.msg | 3 - js/src/builtin/TestingFunctions.cpp | 9 -- js/src/frontend/BytecodeEmitter.cpp | 5 - js/src/frontend/FoldConstants.cpp | 4 +- js/src/frontend/FullParseHandler.h | 55 ++------- js/src/frontend/ParseNode.h | 67 ++--------- js/src/frontend/Parser.cpp | 140 +---------------------- js/src/frontend/Parser.h | 4 - js/src/frontend/SyntaxParseHandler.h | 17 +-- js/src/frontend/TokenKind.h | 3 +- js/src/tests/non262/decorators/syntax.js | 29 ----- 11 files changed, 24 insertions(+), 312 deletions(-) delete mode 100644 js/src/tests/non262/decorators/syntax.js diff --git a/js/public/friend/ErrorNumbers.msg b/js/public/friend/ErrorNumbers.msg index 1287600a074e..d7c615f9d59a 100644 --- a/js/public/friend/ErrorNumbers.msg +++ b/js/public/friend/ErrorNumbers.msg @@ -334,7 +334,6 @@ MSG_DEF(JSMSG_PAREN_BEFORE_FORMAL, 0, JSEXN_SYNTAXERR, "missing ( before for MSG_DEF(JSMSG_PAREN_BEFORE_SWITCH, 0, JSEXN_SYNTAXERR, "missing ( before switch expression") MSG_DEF(JSMSG_PAREN_BEFORE_WITH, 0, JSEXN_SYNTAXERR, "missing ( before with-statement object") MSG_DEF(JSMSG_PAREN_IN_PAREN, 0, JSEXN_SYNTAXERR, "missing ) in parenthetical") -MSG_DEF(JSMSG_PAREN_AFTER_DECORATOR, 0, JSEXN_SYNTAXERR, "missing ) in decorator expression") MSG_DEF(JSMSG_RC_AFTER_EXPORT_SPEC_LIST, 0, JSEXN_SYNTAXERR, "missing '}' after export specifier list") MSG_DEF(JSMSG_RC_AFTER_IMPORT_SPEC_LIST, 0, JSEXN_SYNTAXERR, "missing '}' after module specifier list") MSG_DEF(JSMSG_RESERVED_ID, 1, JSEXN_SYNTAXERR, "{0} is a reserved identifier") @@ -389,8 +388,6 @@ MSG_DEF(JSMSG_DUPLICATE_ASSERT_KEY, 1, JSEXN_SYNTAXERR, "duplicate assert key MSG_DEF(JSMSG_COLON_AFTER_ASSERT_KEY, 0, JSEXN_SYNTAXERR, "missing : after assert key") MSG_DEF(JSMSG_ASSERT_STRING_LITERAL, 0, JSEXN_SYNTAXERR, "expected string literal") MSG_DEF(JSMSG_ASSERT_KEY_EXPECTED, 0, JSEXN_SYNTAXERR, "expected assertion key") -MSG_DEF(JSMSG_DECORATOR_NAME_EXPECTED, 0, JSEXN_SYNTAXERR, "expected decorator name after @") -MSG_DEF(JSMSG_CLASS_EXPECTED, 0, JSEXN_SYNTAXERR, "expected class") // UTF-8 source text encoding errors MSG_DEF(JSMSG_BAD_LEADING_UTF8_UNIT, 1, JSEXN_SYNTAXERR, "{0} byte doesn't begin a valid UTF-8 code point") diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index e338e9f20b23..87167b660d3f 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -560,15 +560,6 @@ static bool GetBuildConfiguration(JSContext* cx, unsigned argc, Value* vp) { return false; } -#ifdef ENABLE_DECORATORS - value = BooleanValue(true); -#else - value = BooleanValue(false); -#endif - if (!JS_SetProperty(cx, info, "decorators", value)) { - return false; - } - #ifdef FUZZING value = BooleanValue(true); #else diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 1c68a4856e07..dafed6200836 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -1069,11 +1069,6 @@ restart: MOZ_CRASH("Record and Tuple are not supported yet"); #endif -#ifdef ENABLE_DECORATORS - case ParseNodeKind::DecoratorList: - MOZ_CRASH("Decorators are not supported yet"); -#endif - // Most other binary operations (parsed as lists in SpiderMonkey) may // perform conversions triggering side effects. Math operations perform // ToNumber and may fail invoking invalid user-defined toString/valueOf: diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp index 802c1d8f12b8..c2ffd86a0941 100644 --- a/js/src/frontend/FoldConstants.cpp +++ b/js/src/frontend/FoldConstants.cpp @@ -453,12 +453,10 @@ restart: case ParseNodeKind::SuperCallExpr: case ParseNodeKind::SuperBase: case ParseNodeKind::SetThis: -#ifdef ENABLE_DECORATORS - case ParseNodeKind::DecoratorList: -#endif MOZ_CRASH( "ContainsHoistedDeclaration should have indicated false on " "some parent node without recurring to test this node"); + case ParseNodeKind::LastUnused: case ParseNodeKind::Limit: MOZ_CRASH("unexpected sentinel ParseNodeKind in node"); diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h index 2e46213f6d8f..02078b58efd8 100644 --- a/js/src/frontend/FullParseHandler.h +++ b/js/src/frontend/FullParseHandler.h @@ -372,15 +372,8 @@ class FullParseHandler { ClassNodeType newClass(Node name, Node heritage, LexicalScopeNodeType memberBlock, -#ifdef ENABLE_DECORATORS - ListNodeType decorators, -#endif const TokenPos& pos) { - return new_(name, heritage, memberBlock, -#ifdef ENABLE_DECORATORS - decorators, -#endif - pos); + return new_(name, heritage, memberBlock, pos); } ListNodeType newClassMemberList(uint32_t begin) { return new_(ParseNodeKind::ClassMemberList, @@ -501,61 +494,31 @@ class FullParseHandler { checkAndSetIsDirectRHSAnonFunction(funNode); - return new_( - ParseNodeKind::DefaultConstructor, key, funNode, AccessorType::None, - /* isStatic = */ false, /* initializeIfPrivate = */ nullptr -#ifdef ENABLE_DECORATORS - , - /* decorators = */ nullptr -#endif - ); + return new_(ParseNodeKind::DefaultConstructor, key, funNode, + AccessorType::None, + /* isStatic = */ false, nullptr); } [[nodiscard]] ClassMethod* newClassMethodDefinition( Node key, FunctionNodeType funNode, AccessorType atype, bool isStatic, - mozilla::Maybe initializerIfPrivate -#ifdef ENABLE_DECORATORS - , - ListNodeType decorators -#endif - ) { + mozilla::Maybe initializerIfPrivate) { MOZ_ASSERT(isUsableAsObjectPropertyName(key)); checkAndSetIsDirectRHSAnonFunction(funNode); if (initializerIfPrivate.isSome()) { return new_(ParseNodeKind::ClassMethod, key, funNode, atype, - isStatic, initializerIfPrivate.value() -#ifdef ENABLE_DECORATORS - , - decorators -#endif - ); + isStatic, initializerIfPrivate.value()); } return new_(ParseNodeKind::ClassMethod, key, funNode, atype, - isStatic, /* initializeIfPrivate = */ nullptr -#ifdef ENABLE_DECORATORS - , - decorators -#endif - ); + isStatic, nullptr); } [[nodiscard]] ClassField* newClassFieldDefinition( - Node name, FunctionNodeType initializer, bool isStatic -#ifdef ENABLE_DECORATORS - , - ListNodeType decorators -#endif - ) { + Node name, FunctionNodeType initializer, bool isStatic) { MOZ_ASSERT(isUsableAsObjectPropertyName(name)); - return new_(name, initializer, isStatic -#if ENABLE_DECORATORS - , - decorators -#endif - ); + return new_(name, initializer, isStatic); } [[nodiscard]] StaticClassBlock* newStaticClassBlock(FunctionNodeType block) { diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index c796d9555195..ea95c416f709 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -122,7 +122,6 @@ class FunctionBox; F(WithStmt, BinaryNode) \ F(ReturnStmt, UnaryNode) \ F(NewExpr, BinaryNode) \ - IF_DECORATORS(F(DecoratorList, ListNode)) \ /* Delete operations. These must be sequential. */ \ F(DeleteNameExpr, UnaryNode) \ F(DeletePropExpr, UnaryNode) \ @@ -469,12 +468,6 @@ inline bool IsTypeofKind(ParseNodeKind kind) { * NewExpr (BinaryNode) * left: ctor expression on the left of the '(' * right: Arguments - * DecoratorList (ListNode) - * head: list of N nodes, each item is one of: - * * NameNode (DecoratorMemberExpression) - * * CallNode (DecoratorCallExpression) - * * Node (DecoratorParenthesizedExpression) - * count: N > 0 * DeleteNameExpr, DeletePropExpr, DeleteElemExpr, DeleteExpr (UnaryNode) * kid: expression that's evaluated, then the overall delete evaluates to * true; can't be a kind for a more-specific ParseNodeKind::Delete* @@ -2201,10 +2194,6 @@ class ClassMethod : public BinaryNode { AccessorType accessorType_; FunctionNode* initializerIfPrivate_; -#ifdef ENABLE_DECORATORS - ListNode* decorators_; -#endif - public: /* * Method definitions often keep a name and function body that overlap, @@ -2212,22 +2201,12 @@ class ClassMethod : public BinaryNode { */ ClassMethod(ParseNodeKind kind, ParseNode* name, ParseNode* body, AccessorType accessorType, bool isStatic, - FunctionNode* initializerIfPrivate -#ifdef ENABLE_DECORATORS - , - ListNode* decorators -#endif - ) + FunctionNode* initializerIfPrivate) : BinaryNode(kind, TokenPos(name->pn_pos.begin, body->pn_pos.end), name, body), isStatic_(isStatic), accessorType_(accessorType), - initializerIfPrivate_(initializerIfPrivate) -#ifdef ENABLE_DECORATORS - , - decorators_(decorators) -#endif - { + initializerIfPrivate_(initializerIfPrivate) { MOZ_ASSERT(kind == ParseNodeKind::DefaultConstructor || kind == ParseNodeKind::ClassMethod); } @@ -2248,29 +2227,16 @@ class ClassMethod : public BinaryNode { AccessorType accessorType() const { return accessorType_; } FunctionNode* initializerIfPrivate() const { return initializerIfPrivate_; } - -#ifdef ENABLE_DECORATORS - ListNode* decorators() const { return decorators_; } -#endif }; class ClassField : public BinaryNode { bool isStatic_; -#ifdef ENABLE_DECORATORS - ListNode* decorators_; -#endif public: - ClassField(ParseNode* name, ParseNode* initializer, bool isStatic -#ifdef ENABLE_DECORATORS - , - ListNode* decorators -#endif - ) + ClassField(ParseNode* name, ParseNode* initializer, bool isStatic) : BinaryNode(ParseNodeKind::ClassField, initializer->pn_pos, name, initializer), - isStatic_(isStatic) { - } + isStatic_(isStatic) {} static bool test(const ParseNode& node) { bool match = node.isKind(ParseNodeKind::ClassField); @@ -2283,10 +2249,6 @@ class ClassField : public BinaryNode { FunctionNode* initializer() const { return &right()->as(); } bool isStatic() const { return isStatic_; } - -#ifdef ENABLE_DECORATORS - ListNode* decorators() const { return decorators_; } -#endif }; // Hold onto the function generated for a class static block like @@ -2414,23 +2376,11 @@ class ClassNode : public TernaryNode { return &innerScope()->scopeBody()->as(); } -#ifdef ENABLE_DECORATORS - ListNode* decorators_; -#endif - public: ClassNode(ParseNode* names, ParseNode* heritage, - LexicalScopeNode* memberBlock, -#ifdef ENABLE_DECORATORS - ListNode* decorators, -#endif - const TokenPos& pos) - : TernaryNode(ParseNodeKind::ClassDecl, names, heritage, memberBlock, pos) -#ifdef ENABLE_DECORATORS - , - decorators_(decorators) -#endif - { + LexicalScopeNode* memberBlock, const TokenPos& pos) + : TernaryNode(ParseNodeKind::ClassDecl, names, heritage, memberBlock, + pos) { MOZ_ASSERT(innerScope()->scopeBody()->is()); MOZ_ASSERT_IF(names, names->is()); } @@ -2458,9 +2408,6 @@ class ClassNode : public TernaryNode { ClassBodyScopeNode* scope = bodyScope(); return scope->isEmptyScope() ? nullptr : scope; } -#ifdef ENABLE_DECORATORS - ListNode* decorators() const { return decorators_; } -#endif }; #ifdef DEBUG diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index dc686a208b98..574a1adaa5f6 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -7630,80 +7630,6 @@ static AccessorType ToAccessorType(PropertyType propType) { } } -#ifdef ENABLE_DECORATORS -template -typename ParseHandler::ListNodeType -GeneralParser::decoratorList(YieldHandling yieldHandling) { - ListNodeType decorators = - handler_.newList(ParseNodeKind::DecoratorList, pos()); - - // Build a decorator list element. At each entry point to this loop we have - // already consumed the |@| token - TokenKind tt; - for (;;) { - if (!tokenStream.getToken(&tt, TokenStream::SlashIsInvalid)) { - return null(); - } - - Node decorator = null(); - if (tt == TokenKind::LeftParen) { - // Handle DecoratorParenthesizedExpression - decorator = exprInParens(InAllowed, yieldHandling, TripledotProhibited); - if (!decorator) { - return null(); - } - - if (!mustMatchToken(TokenKind::RightParen, JSMSG_PAREN_AFTER_DECORATOR)) { - return null(); - } - - if (!tokenStream.getToken(&tt)) { - return null(); - } - } else { - // Get decorator identifier - if (!(tt == TokenKind::Name || TokenKindIsContextualKeyword(tt))) { - error(JSMSG_DECORATOR_NAME_EXPECTED); - return null(); - } - TaggedParserAtomIndex name = anyChars.currentName(); - if (!tokenStream.getToken(&tt)) { - return null(); - } - - if (tt == TokenKind::LeftParen) { - // Handle DecoratorCallExpression - Node decoratorName = handler_.newName(name, pos()); - bool isSpread = false; - Node args = argumentList(yieldHandling, &isSpread); - if (!args) { - return null(); - } - decorator = handler_.newCall(decoratorName, args, - isSpread ? JSOp::SpreadCall : JSOp::Call); - - if (!tokenStream.getToken(&tt)) { - return null(); - } - } else { - // Handle DecoratorMemberExpression - // TODO: Bug 1784513, handle decorator member expressions with `.` in - // them. - decorator = handler_.newName(name, pos()); - } - } - MOZ_ASSERT(decorator, "Decorator should exist"); - handler_.addList(decorators, decorator); - - if (tt != TokenKind::At) { - anyChars.ungetToken(); - break; - } - } - return decorators; -} -#endif - template bool GeneralParser::classMember( YieldHandling yieldHandling, const ParseContext::ClassStatement& classStmt, @@ -7725,20 +7651,6 @@ bool GeneralParser::classMember( return true; } -#ifdef ENABLE_DECORATORS - ListNodeType decorators; - if (tt == TokenKind::At) { - decorators = decoratorList(yieldHandling); - if (!decorators) { - return false; - } - - if (!tokenStream.getToken(&tt, TokenStream::SlashIsInvalid)) { - return false; - } - } -#endif - bool isStatic = false; if (tt == TokenKind::Static) { if (!tokenStream.peekToken(&tt)) { @@ -7833,12 +7745,7 @@ bool GeneralParser::classMember( } ClassFieldType field = - handler_.newClassFieldDefinition(propName, initializer, isStatic -#ifdef ENABLE_DECORATORS - , - decorators -#endif - ); + handler_.newClassFieldDefinition(propName, initializer, isStatic); if (!field) { return false; } @@ -8000,13 +7907,8 @@ bool GeneralParser::classMember( } } - Node method = handler_.newClassMethodDefinition(propName, funNode, atype, - isStatic, initializerIfPrivate -#ifdef ENABLE_DECORATORS - , - decorators -#endif - ); + Node method = handler_.newClassMethodDefinition( + propName, funNode, atype, isStatic, initializerIfPrivate); if (!method) { return false; } @@ -8100,28 +8002,7 @@ typename ParseHandler::ClassNodeType GeneralParser::classDefinition( YieldHandling yieldHandling, ClassContext classContext, DefaultHandling defaultHandling) { -#ifdef ENABLE_DECORATORS - MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::At) || - anyChars.isCurrentTokenType(TokenKind::Class)); - - ListNodeType decorators = null(); - if (anyChars.isCurrentTokenType(TokenKind::At)) { - decorators = decoratorList(yieldHandling); - if (!decorators) { - return null(); - } - TokenKind next; - if (!tokenStream.getToken(&next)) { - return null(); - } - if (next != TokenKind::Class) { - error(JSMSG_CLASS_EXPECTED); - return null(); - } - } -#else MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Class)); -#endif uint32_t classStartOffset = pos().begin; bool savedStrictness = setLocalStrictMode(true); @@ -8334,9 +8215,6 @@ GeneralParser::classDefinition( } return handler_.newClass(nameNode, classHeritage, classBlock, -#ifdef ENABLE_DECORATORS - decorators, -#endif TokenPos(classStartOffset, classEndOffset)); } @@ -9459,12 +9337,7 @@ GeneralParser::statementListItem( case TokenKind::Function: return functionStmt(pos().begin, yieldHandling, NameRequired); - // DecoratorList[?Yield, ?Await] opt ClassDeclaration[?Yield, ~Default] -#ifdef ENABLE_DECORATORS - case TokenKind::At: - return classDefinition(yieldHandling, ClassExpression, NameRequired); -#endif - + // ClassDeclaration[?Yield, ~Default] case TokenKind::Class: return classDefinition(yieldHandling, ClassStatement, NameRequired); @@ -12542,11 +12415,6 @@ typename ParseHandler::Node GeneralParser::primaryExpr( return tupleLiteral(yieldHandling); #endif -#ifdef ENABLE_DECORATORS - case TokenKind::At: - return classDefinition(yieldHandling, ClassExpression, NameRequired); -#endif - case TokenKind::LeftParen: { TokenKind next; if (!tokenStream.peekToken(&next, TokenStream::SlashIsRegExp)) { diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h index 74dfbdc15057..a77ea58e820b 100644 --- a/js/src/frontend/Parser.h +++ b/js/src/frontend/Parser.h @@ -1271,7 +1271,6 @@ class MOZ_STACK_CLASS GeneralParser : public PerHandlerParser { ClassNodeType classDefinition(YieldHandling yieldHandling, ClassContext classContext, DefaultHandling defaultHandling); - struct ClassInitializedMembers { // The number of instance class fields. size_t instanceFields = 0; @@ -1298,9 +1297,6 @@ class MOZ_STACK_CLASS GeneralParser : public PerHandlerParser { return privateMethods > 0 || privateAccessors > 0; } }; -#ifdef ENABLE_DECORATORS - ListNodeType decoratorList(YieldHandling yieldHandling); -#endif [[nodiscard]] bool classMember( YieldHandling yieldHandling, const ParseContext::ClassStatement& classStmt, diff --git a/js/src/frontend/SyntaxParseHandler.h b/js/src/frontend/SyntaxParseHandler.h index 6ba60a31caa9..0739bb13e11d 100644 --- a/js/src/frontend/SyntaxParseHandler.h +++ b/js/src/frontend/SyntaxParseHandler.h @@ -332,9 +332,6 @@ class SyntaxParseHandler { return NodeGeneric; } ClassNodeType newClass(Node name, Node heritage, Node methodBlock, -#ifdef ENABLE_DECORATORS - ListNodeType decorators, -#endif const TokenPos& pos) { return NodeGeneric; } @@ -388,22 +385,12 @@ class SyntaxParseHandler { } [[nodiscard]] Node newClassMethodDefinition( Node key, FunctionNodeType funNode, AccessorType atype, bool isStatic, - mozilla::Maybe initializerIfPrivate -#ifdef ENABLE_DECORATORS - , - ListNodeType decorators -#endif - ) { + mozilla::Maybe initializerIfPrivate) { return NodeGeneric; } [[nodiscard]] Node newClassFieldDefinition(Node name, FunctionNodeType initializer, - bool isStatic -#ifdef ENABLE_DECORATORS - , - ListNodeType decorators -#endif - ) { + bool isStatic) { return NodeGeneric; } diff --git a/js/src/frontend/TokenKind.h b/js/src/frontend/TokenKind.h index 102b91c6c402..026d7c981ac6 100644 --- a/js/src/frontend/TokenKind.h +++ b/js/src/frontend/TokenKind.h @@ -123,14 +123,13 @@ MACRO(Import, "keyword 'import'") \ MACRO(Class, "keyword 'class'") \ MACRO(Extends, "keyword 'extends'") \ + IF_DECORATORS(MACRO(Accessor, "keyword 'accessor'")) \ MACRO(Super, "keyword 'super'") \ RANGE(KeywordLast, Super) \ \ /* contextual keywords */ \ MACRO(As, "'as'") \ RANGE(ContextualKeywordFirst, As) \ - /* TODO: Move to alphabetical order when IF_DECORATORS is removed */ \ - IF_DECORATORS(MACRO(Accessor, "'accessor'")) \ MACRO(Assert, "'assert'") \ MACRO(Async, "'async'") \ MACRO(Await, "'await'") \ diff --git a/js/src/tests/non262/decorators/syntax.js b/js/src/tests/non262/decorators/syntax.js deleted file mode 100644 index 78b0251bf32c..000000000000 --- a/js/src/tests/non262/decorators/syntax.js +++ /dev/null @@ -1,29 +0,0 @@ -// |reftest| skip-if(!getBuildConfiguration()['decorators']) - -Reflect.parse("class c {@dec1 field = false;}"); -Reflect.parse("class c {@dec1 @dec2 @dec3 field = false;}"); -Reflect.parse("class c {@dec1 @dec2 @dec3('a') static field = false;}"); -Reflect.parse("class c {@dec1 method() {};}"); -Reflect.parse("class c {@dec1 @dec2 @dec3 method() {};}"); -Reflect.parse("class c {@dec1 @dec2 @dec3 static method() {};}"); -Reflect.parse("class c {@dec1 @dec2('a') @dec3 method(...args) {};}"); -Reflect.parse("class c {@((a, b, c) => {}) method(a, b) {};}"); -Reflect.parse("class c {@((a, b, c) => {}) @dec2('a', 'b') @dec3 method(a, b) {};}"); -Reflect.parse("@dec1 class c {}"); -Reflect.parse("@dec1 @dec2 @dec3 class c {}"); -Reflect.parse("@dec1('a') @(() => {}) @dec3 class c {}"); -Reflect.parse("@dec1('a') @(() => {}) @dec3 class c {@((a, b, c) => {}) @dec2('a', 'b') @dec3 method(a, b) {};}"); -Reflect.parse("x = @dec class { #x }"); -Reflect.parse("x = (class A { }, @dec class { })"); -Reflect.parse("@dec1 class A extends @dec2 class B extends @dec3 class {} {} {}"); - -assertThrowsInstanceOf(() => Reflect.parse("class c {@ method() {};}"), SyntaxError); -assertThrowsInstanceOf(() => Reflect.parse("class c {@((a, b, c => {}) method(a, b) {};}"), SyntaxError); -assertThrowsInstanceOf(() => Reflect.parse("class c {@dec1 static @dec2 method(a, b) {};}"), SyntaxError); -assertThrowsInstanceOf(() => Reflect.parse("@dec1 let x = 1"), SyntaxError); -assertThrowsInstanceOf(() => Reflect.parse("@dec1 f(a) {}"), SyntaxError); -assertThrowsInstanceOf(() => Reflect.parse("@dec1 () => {}"), SyntaxError); -assertThrowsInstanceOf(() => Reflect.parse("@class class { x; }"), SyntaxError); -assertThrowsInstanceOf(() => Reflect.parse("@for class { x; }"), SyntaxError); - -if (typeof reportCompare === "function") reportCompare(0, 0);