Skip to content

Commit

Permalink
doc(es/typescript): Fix example (#8952)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Closes #8950
  • Loading branch information
kdy1 committed May 14, 2024
1 parent 3887a51 commit ff60960
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/swc_ecma_transforms_typescript/examples/ts_to_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

Expand All @@ -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![];
{
Expand All @@ -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?"));
Expand Down

0 comments on commit ff60960

Please sign in to comment.