mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
fix(codegen): print raw if value is number is Infinity (#4676)
This commit is contained in:
parent
3987665490
commit
4a5695416d
3 changed files with 3 additions and 5 deletions
|
|
@ -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(());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1192,7 +1192,7 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> 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 {
|
||||
|
|
|
|||
|
|
@ -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%)
|
||||
|
|
|
|||
Loading…
Reference in a new issue