refactor: ban std.debug.assert (#10168)

* Ban `std.debug.assert`

* Create .clangd

* Update lint.yml

* Update linter.ts

* update

* lint

* Update linter.ts

* Update linter.ts

* update

* Update linter.ts

* update

* Update linter.ts

* more

* Update install.zig

* words

* Remove UB
This commit is contained in:
Jarred Sumner
2024-04-11 17:52:29 -07:00
committed by GitHub
parent 0f10d4f1be
commit 688844b472
149 changed files with 1314 additions and 1105 deletions

View File

@@ -143,7 +143,7 @@ pub const MutableString = struct {
}
if (comptime bun.Environment.allow_assert) {
std.debug.assert(js_lexer.isIdentifier(mutable.list.items));
bun.assert(js_lexer.isIdentifier(mutable.list.items));
}
return try mutable.list.toOwnedSlice(allocator);
@@ -193,7 +193,7 @@ pub const MutableString = struct {
self: *MutableString,
index: usize,
) void {
std.debug.assert(index <= self.list.capacity);
bun.assert(index <= self.list.capacity);
self.list.items.len = index;
}
@@ -215,7 +215,7 @@ pub const MutableString = struct {
try self.list.ensureUnusedCapacity(self.allocator, count);
const old = self.list.items.len;
self.list.items.len += count;
std.debug.assert(count == bun.fmt.formatIntBuf(self.list.items.ptr[old .. old + count], int, 10, .lower, .{}));
bun.assert(count == bun.fmt.formatIntBuf(self.list.items.ptr[old .. old + count], int, 10, .lower, .{}));
}
pub inline fn appendAssumeCapacity(self: *MutableString, char: []const u8) void {