fix(common): Fix StringInput.end_pos (#9362)

This commit is contained in:
Donny/강동윤 2024-08-01 15:01:32 +09:00 committed by GitHub
parent dd4b78248a
commit 5368e189ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
swc_common: patch
---
fix(common): Fix `StringInput.end_pos`

View File

@ -15,6 +15,7 @@ pub struct StringInput<'a> {
orig: &'a str,
/// Original start position.
orig_start: BytePos,
orig_end: BytePos,
}
impl<'a> StringInput<'a> {
@ -34,6 +35,7 @@ impl<'a> StringInput<'a> {
orig: src,
iter: src.chars(),
orig_start: start,
orig_end: end,
}
}
@ -55,7 +57,7 @@ impl<'a> StringInput<'a> {
}
pub fn end_pos(&self) -> BytePos {
self.last_pos
self.orig_end
}
}