diff options
author | 2021-10-24 15:55:27 -0700 | |
---|---|---|
committer | 2021-10-24 15:55:27 -0700 | |
commit | 213f361551c53169371d9e929be815512df22d00 (patch) | |
tree | c44b609269e142f43e71ff872cb6a60743483786 | |
parent | 35829417915d3dc0d60da7719b7e586a983ecac5 (diff) | |
download | bun-213f361551c53169371d9e929be815512df22d00.tar.gz bun-213f361551c53169371d9e929be815512df22d00.tar.zst bun-213f361551c53169371d9e929be815512df22d00.zip |
[internal] Handle allocation failure
-rw-r--r-- | src/string_immutable.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig index a6f018192..0030b8708 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -501,7 +501,7 @@ pub fn toUTF8Alloc(allocator: *std.mem.Allocator, js: []const u16) !string { } } const width = encodeWTF8Rune(&temp, r1); - list.appendSlice(temp[0..width]) catch unreachable; + try list.appendSlice(temp[0..width]); } return list.items; } |