Add a debug assertion

This commit is contained in:
Jarred Sumner
2024-09-06 16:58:08 -07:00
parent 69f97cecf0
commit 3f9ad7cefc

View File

@@ -45,6 +45,7 @@ pub const MutableString = struct {
}
pub fn write(self: *MutableString, bytes: anytype) !usize {
bun.debugAssert(bytes.len == 0 or !bun.isSliceInBuffer(bytes, self.list.allocatedSlice()));
try self.list.appendSlice(self.allocator, bytes);
return bytes.len;
}