diff --git a/crates/oxc_ast/src/ast_impl/literal.rs b/crates/oxc_ast/src/ast_impl/literal.rs index a8919a930..0e12ff1cb 100644 --- a/crates/oxc_ast/src/ast_impl/literal.rs +++ b/crates/oxc_ast/src/ast_impl/literal.rs @@ -9,7 +9,7 @@ use std::{ use oxc_allocator::CloneIn; use oxc_regular_expression::ast::Pattern; -use oxc_span::{cmp::ContentEq, hash::ContentHash, Atom, Span}; +use oxc_span::{cmp::ContentEq, hash::ContentHash, Span}; use crate::ast::*; @@ -263,11 +263,6 @@ impl fmt::Display for RegExpFlags { } impl<'a> StringLiteral<'a> { - /// Create a new string literal representing the given `value`. - pub fn new(span: Span, value: Atom<'a>) -> Self { - Self { span, value } - } - /// Static Semantics: `IsStringWellFormedUnicode` /// test for \uD800-\uDFFF /// diff --git a/crates/oxc_transformer/src/common/module_imports.rs b/crates/oxc_transformer/src/common/module_imports.rs index 49fc904cd..2481d0c00 100644 --- a/crates/oxc_transformer/src/common/module_imports.rs +++ b/crates/oxc_transformer/src/common/module_imports.rs @@ -214,7 +214,7 @@ impl<'a> ModuleImportsStore<'a> { let import_stmt = ctx.ast.module_declaration_import_declaration( SPAN, Some(specifiers), - StringLiteral::new(SPAN, source), + ctx.ast.string_literal(SPAN, source), NONE, ImportOrExportKind::Value, );