diff --git a/crates/oxc_codegen/examples/codegen.rs b/crates/oxc_codegen/examples/codegen.rs index ccd10b491884c..46df21a933d98 100644 --- a/crates/oxc_codegen/examples/codegen.rs +++ b/crates/oxc_codegen/examples/codegen.rs @@ -50,8 +50,7 @@ fn main() -> std::io::Result<()> { let ret = Parser::new(&allocator, &printed, source_type).parse(); if !ret.errors.is_empty() { for error in ret.errors { - let error = error.with_source_code(source_text.to_string()); - println!("{error:?}"); + println!("{:?}", error.with_source_code(printed.to_string())); } return Ok(()); } diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 2a0dad411c88f..75ed41e175feb 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -1192,7 +1192,7 @@ impl<'a, const MINIFY: bool> Gen for NumericLiteral<'a> { let bytes = result.as_str(); p.print_str(bytes); need_space_before_dot(bytes, p); - } else if self.value == f64::INFINITY { + } else if self.value == f64::INFINITY && self.raw.is_empty() { p.print_str("Infinity"); need_space_before_dot("Infinity", p); } else { diff --git a/tasks/coverage/codegen_typescript.snap b/tasks/coverage/codegen_typescript.snap index 6bf841072bd1c..2175bebfdd861 100644 --- a/tasks/coverage/codegen_typescript.snap +++ b/tasks/coverage/codegen_typescript.snap @@ -2,5 +2,4 @@ commit: d8086f14 codegen_typescript Summary: AST Parsed : 6456/6456 (100.00%) -Positive Passed: 6455/6456 (99.98%) -Normal failed: "compiler/deferredConditionalTypes2.ts" +Positive Passed: 6456/6456 (100.00%)