Skip to content

Commit 14feedb

Browse files
authored
fix(swc_common): Fix skip condition for sourcemap, really (#10563)
**Description:** Cursor removed my changes on the tab in the previous PR.
1 parent a99005a commit 14feedb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/clever-donkeys-protect.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
swc_core: patch
3+
swc_common: patch
4+
---
5+
6+
fix(swc_common): Fix skip condition for sourcemap, really

crates/swc_common/src/source_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,9 +1293,9 @@ pub fn build_source_map(
12931293

12941294
let lc = *lc;
12951295

1296-
// If pos is same as a DUMMY_SP (eg BytePos(0)) or if line and col are 0,
1296+
// If pos is same as a DUMMY_SP (eg BytePos(0)) or if line and col are 0;
12971297
// ignore the mapping.
1298-
if lc.line == 0 && lc.col == 0 && pos.is_dummy() {
1298+
if pos.is_dummy() || (lc.line == 0 && lc.col == 0) {
12991299
continue;
13001300
}
13011301

0 commit comments

Comments
 (0)