From 746940d21eced8b5057392efa5666e4d2be23df1 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 17 Apr 2023 01:20:38 -0700 Subject: Fixes #2634 --- src/js_lexer.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/js_lexer.zig b/src/js_lexer.zig index 8ff73fcb6..98393080b 100644 --- a/src/js_lexer.zig +++ b/src/js_lexer.zig @@ -782,12 +782,12 @@ fn NewLexer_( } inline fn nextCodepointSlice(it: *LexerType) []const u8 { - const cp_len = strings.wtf8ByteSequenceLength(it.source.contents.ptr[it.current]); + 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 ""; } inline fn nextCodepoint(it: *LexerType) CodePoint { - const cp_len = strings.wtf8ByteSequenceLength(it.source.contents.ptr[it.current]); + const cp_len = strings.wtf8ByteSequenceLengthWithInvalid(it.source.contents.ptr[it.current]); const slice = if (!(cp_len + it.current > it.source.contents.len)) it.source.contents[it.current .. cp_len + it.current] else ""; const code_point = switch (slice.len) { -- cgit v1.2.3