refactor OOM errors (#11540)

This commit is contained in:
Ciro Spaciari
2024-06-03 02:56:26 -03:00
committed by GitHub
parent eb31675af9
commit 1d89c5988e
27 changed files with 74 additions and 74 deletions

View File

@@ -228,7 +228,7 @@ pub const MutableString = struct {
}
pub fn toOwnedSlice(self: *MutableString) string {
return self.list.toOwnedSlice(self.allocator) catch @panic("Allocation Error"); // TODO
return self.list.toOwnedSlice(self.allocator) catch bun.outOfMemory(); // TODO
}
pub fn toOwnedSliceLeaky(self: *MutableString) []u8 {
@@ -255,7 +255,7 @@ pub const MutableString = struct {
pub fn toOwnedSliceLength(self: *MutableString, length: usize) string {
self.list.shrinkAndFree(self.allocator, length);
return self.list.toOwnedSlice(self.allocator) catch @panic("Allocation Error"); // TODO
return self.list.toOwnedSlice(self.allocator) catch bun.outOfMemory(); // TODO
}
// pub fn deleteAt(self: *MutableString, i: usize) {