diff --git a/crates/oxc_ast/src/ast_impl/literal.rs b/crates/oxc_ast/src/ast_impl/literal.rs index a0ea735a17a8c..a8919a9302e9c 100644 --- a/crates/oxc_ast/src/ast_impl/literal.rs +++ b/crates/oxc_ast/src/ast_impl/literal.rs @@ -10,7 +10,6 @@ use std::{ use oxc_allocator::CloneIn; use oxc_regular_expression::ast::Pattern; use oxc_span::{cmp::ContentEq, hash::ContentHash, Atom, Span}; -use oxc_syntax::number::NumberBase; use crate::ast::*; @@ -59,11 +58,6 @@ impl fmt::Display for NullLiteral { } impl<'a> NumericLiteral<'a> { - /// Create a numeric literal representing the given `value`. - pub fn new(span: Span, value: f64, raw: &'a str, base: NumberBase) -> Self { - Self { span, value, raw, base } - } - /// port from [closure compiler](https://github.com/google/closure-compiler/blob/a4c880032fba961f7a6c06ef99daa3641810bfdd/src/com/google/javascript/jscomp/base/JSCompDoubles.java#L113) /// /// diff --git a/crates/oxc_parser/src/js/expression.rs b/crates/oxc_parser/src/js/expression.rs index 2dc3a507eedfe..aca97d9886a59 100644 --- a/crates/oxc_parser/src/js/expression.rs +++ b/crates/oxc_parser/src/js/expression.rs @@ -321,7 +321,7 @@ impl<'a> ParserImpl<'a> { _ => return Err(self.unexpected()), }; self.bump_any(); - Ok(NumericLiteral::new(self.end_span(span), value, src, base)) + Ok(self.ast.numeric_literal(self.end_span(span), value, src, base)) } pub(crate) fn parse_literal_bigint(&mut self) -> Result> {