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?"));