diff --git a/crates/oxc_parser/src/js/class.rs b/crates/oxc_parser/src/js/class.rs index b60e80b56..49599943a 100644 --- a/crates/oxc_parser/src/js/class.rs +++ b/crates/oxc_parser/src/js/class.rs @@ -172,7 +172,10 @@ impl<'a> ParserImpl<'a> { let modifier = self.parse_class_element_modifiers(false); - let accessor = self.peek_kind().is_class_element_name_start() && self.eat(Kind::Accessor); + let accessor = { + let token = self.peek_token(); + !token.is_on_new_line && token.kind.is_class_element_name_start() + } && self.eat(Kind::Accessor); let accessibility = modifier.accessibility(); diff --git a/tasks/coverage/codegen_runtime_test262.snap b/tasks/coverage/codegen_runtime_test262.snap index 98c6a4a1c..cc94e0eec 100644 --- a/tasks/coverage/codegen_runtime_test262.snap +++ b/tasks/coverage/codegen_runtime_test262.snap @@ -1,6 +1,6 @@ codegen_runtime_test262 Summary: AST Parsed : 19407/19407 (100.00%) -Positive Passed: 19258/19407 (99.23%) +Positive Passed: 19260/19407 (99.24%) Expect to run correctly: "annexB/built-ins/String/prototype/substr/surrogate-pairs.js" But got a runtime error: Test262Error: start: 1 Expected SameValue(«�», «\udf06») to be true @@ -205,9 +205,6 @@ But got a runtime error: TypeError: c[(intermediate value)] is not a function Expect to run correctly: "language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-function-expression.js" But got a runtime error: TypeError: c[(intermediate value)] is not a function -Expect to run correctly: "language/expressions/class/elements/field-definition-accessor-no-line-terminator.js" -But got a runtime error: SyntaxError: Unexpected identifier '$' - Expect to run correctly: "language/expressions/compound-assignment/compound-assignment-operator-calls-putvalue-lref--v--1.js" But got a runtime error: Test262Error: Expected a ReferenceError but got a TypeError @@ -418,9 +415,6 @@ But got a runtime error: TypeError: c[(intermediate value)] is not a function Expect to run correctly: "language/statements/class/cpn-class-decl-fields-methods-computed-property-name-from-function-expression.js" But got a runtime error: TypeError: c[(intermediate value)] is not a function -Expect to run correctly: "language/statements/class/elements/field-definition-accessor-no-line-terminator.js" -But got a runtime error: SyntaxError: Unexpected identifier '$' - Expect to run correctly: "language/statements/class/subclass/default-constructor-spread-override.js" But got a runtime error: Test262Error: @@iterator invoked