Skip to content

Commit

Permalink
one more
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-conway committed Feb 8, 2025
1 parent 5f8ce80 commit 12036b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/js_lexer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ fn NewLexer_(
}

inline fn nextCodepointSlice(it: *LexerType) []const u8 {
if (it.current >= it.source.contents.len) {
return "";
}
const cp_len = strings.wtf8ByteSequenceLengthWithInvalid(it.source.contents.ptr[it.current]);
return if (!(cp_len + it.current > it.source.contents.len)) it.source.contents[it.current .. cp_len + it.current] else "";
}
Expand Down

0 comments on commit 12036b1

Please sign in to comment.