From ff60960afe3f2866e5c98f0414884fa93b5ab3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 14 May 2024 09:55:06 +0900 Subject: [PATCH] doc(es/typescript): Fix example (#8952) **Related issue:** - Closes #8950 --- crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs b/crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs index fd70e020fd72..00e0b3c41f77 100644 --- a/crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs +++ b/crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs @@ -52,7 +52,7 @@ fn main() { } let module = parser - .parse_module() + .parse_program() .map_err(|e| e.into_diagnostic(&handler).emit()) .expect("failed to parse module."); @@ -74,7 +74,7 @@ fn main() { let module = module.fold_with(&mut hygiene()); // Ensure that we have enough parenthesis. - let module = module.fold_with(&mut fixer(Some(&comments))); + let program = module.fold_with(&mut fixer(Some(&comments))); let mut buf = vec![]; { @@ -85,7 +85,7 @@ fn main() { wr: JsWriter::new(cm.clone(), "\n", &mut buf, None), }; - emitter.emit_module(&module).unwrap(); + emitter.emit_program(&program).unwrap(); } println!("{}", String::from_utf8(buf).expect("non-utf8?"));