refactor(ast, transformer)!: remove StringLiteral::new method (#6788)

This commit is contained in:
overlookmotel 2024-10-23 03:36:32 +00:00
parent a1ca964560
commit 4d2d214ec7
2 changed files with 2 additions and 7 deletions

View file

@ -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
///

View file

@ -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,
);