Skip to content

Commit ff6bbcc

Browse files
committed
fixup: slash merging
1 parent a580a32 commit ff6bbcc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/async-rewriter2/src/async-writer-babel.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ describe('AsyncWriter', function () {
119119
expect(runTranspiledCode('undefined')).to.equal(undefined);
120120
expect(runTranspiledCode('[1,2,3]')).to.deep.equal([1, 2, 3]);
121121
expect(runTranspiledCode('({ a: 10 })')).to.deep.equal({ a: 10 });
122+
// make sure that inserted debugging comments do not merge with division slashes
123+
expect(runTranspiledCode('6/3')).to.deep.equal(2);
122124
});
123125

124126
it('does not auto-resolve Promises automatically', function () {

packages/async-rewriter3/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ fn collect_insertions(node: &SyntaxNode, nesting_depth: u32) -> InsertionList {
255255
let kind = child.kind();
256256
if kind != SyntaxKind::TEMPLATE_ELEMENT {
257257
insertions.push_back(Insertion::new_dynamic(range.start(),
258-
["/*", format!("{kind:#?}").as_str(), "*/"].concat()
258+
[" /*", format!("{kind:#?}").as_str(), "*/ "].concat()
259259
));
260260
}
261261
}

0 commit comments

Comments
 (0)