Skip to content

Commit

Permalink
fix(common): Fix StringInput.end_pos (#9362)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Aug 1, 2024
1 parent dd4b782 commit 5368e18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/pink-pianos-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
swc_common: patch
---

fix(common): Fix `StringInput.end_pos`
4 changes: 3 additions & 1 deletion crates/swc_common/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub struct StringInput<'a> {
orig: &'a str,
/// Original start position.
orig_start: BytePos,
orig_end: BytePos,
}

impl<'a> StringInput<'a> {
Expand All @@ -34,6 +35,7 @@ impl<'a> StringInput<'a> {
orig: src,
iter: src.chars(),
orig_start: start,
orig_end: end,
}
}

Expand All @@ -55,7 +57,7 @@ impl<'a> StringInput<'a> {
}

pub fn end_pos(&self) -> BytePos {
self.last_pos
self.orig_end
}
}

Expand Down

0 comments on commit 5368e18

Please sign in to comment.