Skip to content

Commit 3149fac

Browse files
committed
fixup: extend ; safeguarding
1 parent 8cabf98 commit 3149fac

File tree

1 file changed

+3
-3
lines changed
  • packages/async-rewriter3/src

1 file changed

+3
-3
lines changed

packages/async-rewriter3/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ fn collect_insertions(node: &SyntaxNode, nesting_depth: u32) -> InsertionList {
294294
Some(name) => {
295295
insertions.push_back(Insertion::new(name.text_range().end(), "__"));
296296
insertions.push_back(Insertion::new_dynamic(range.end(),
297-
[";\n_cr = ", name.text(), " = ", name.text(), "__"].concat()
297+
[";\n_cr = ", name.text(), " = ", name.text(), "__;\n"].concat()
298298
));
299299
insertions.add_variable(name.to_string());
300300
}
@@ -372,7 +372,7 @@ fn collect_insertions(node: &SyntaxNode, nesting_depth: u32) -> InsertionList {
372372
}
373373
insertions.append(child_insertions);
374374
if let Some(end) = expr_range.map(|r| r.end()) {
375-
insertions.push_back(Insertion::new(end, ")"));
375+
insertions.push_back(Insertion::new(end, ");"));
376376
}
377377
continue;
378378
}
@@ -473,7 +473,7 @@ fn collect_insertions(node: &SyntaxNode, nesting_depth: u32) -> InsertionList {
473473
if is_returned_expression && !is_expr_in_async_function {
474474
insertions.push_back(Insertion::new(
475475
range.end(),
476-
"), _functionState === 'async' ? _synchronousReturnValue : null)"
476+
"), _functionState === 'async' ? _synchronousReturnValue : null);"
477477
));
478478
}
479479
}

0 commit comments

Comments
 (0)