diff --git a/crates/oxc_parser/src/js/expression.rs b/crates/oxc_parser/src/js/expression.rs index f5371284901ce..e157274a129d6 100644 --- a/crates/oxc_parser/src/js/expression.rs +++ b/crates/oxc_parser/src/js/expression.rs @@ -414,9 +414,7 @@ impl<'a> ParserImpl<'a> { let raw = Atom::from(unsafe { self.source_text.get_unchecked(span.start as usize..span.end as usize) }); - let mut string_literal = self.ast.string_literal(span, value, Some(raw)); - string_literal.lone_surrogates = lone_surrogates; - Ok(string_literal) + Ok(self.ast.string_literal_with_lone_surrogates(span, value, Some(raw), lone_surrogates)) } /// Section [Array Expression](https://tc39.es/ecma262/#prod-ArrayLiteral)