Skip to content

Commit 23cb01c

Browse files
committed
fix ts strip
1 parent 40b6970 commit 23cb01c

File tree

2 files changed

+5
-8
lines changed
  • crates
    • swc_ecma_transforms_proposal/tests/decorators/issue-8629
    • swc_ecma_transforms_typescript/src

2 files changed

+5
-8
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// main.ts
21
var _computedKey;
32
_computedKey = Symbol.dispose;
3+
// main.ts
44
export class Disposable {
55
[_computedKey]() {
66
console.log('dispose');
77
}
88
}
9-
using _disposable = new Disposable()
9+
using _disposable = new Disposable();
1010
console.log('ok');

crates/swc_ecma_transforms_typescript/src/typescript.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,9 @@ where
228228
}
229229

230230
if !self.config.verbatim_module_syntax {
231-
let span = if n.shebang.is_some() {
232-
n.span
233-
.with_lo(n.body.first().map(|s| s.span_lo()).unwrap_or(n.span.lo))
234-
} else {
235-
n.span
236-
};
231+
let span = n
232+
.span
233+
.with_lo(n.body.first().map(|s| s.span_lo()).unwrap_or(n.span.lo));
237234

238235
let JsxDirectives {
239236
pragma,

0 commit comments

Comments
 (0)