mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 21:01:52 +00:00
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:
@@ -25,7 +25,7 @@ const ExprNodeIndex = js_ast.ExprNodeIndex;
|
||||
const ExprNodeList = js_ast.ExprNodeList;
|
||||
const StmtNodeList = js_ast.StmtNodeList;
|
||||
const BindingNodeList = js_ast.BindingNodeList;
|
||||
const assert = std.debug.assert;
|
||||
const assert = bun.assert;
|
||||
|
||||
const LocRef = js_ast.LocRef;
|
||||
const S = js_ast.S;
|
||||
@@ -94,9 +94,9 @@ fn newExpr(t: anytype, loc: logger.Loc) Expr {
|
||||
if (comptime Type == E.Object) {
|
||||
for (t.properties.slice()) |prop| {
|
||||
// json should never have an initializer set
|
||||
std.debug.assert(prop.initializer == null);
|
||||
std.debug.assert(prop.key != null);
|
||||
std.debug.assert(prop.value != null);
|
||||
bun.assert(prop.initializer == null);
|
||||
bun.assert(prop.key != null);
|
||||
bun.assert(prop.value != null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -765,7 +765,7 @@ pub fn ParseJSONUTF8(
|
||||
}
|
||||
|
||||
var parser = try JSONParser.init(allocator, source.*, log);
|
||||
std.debug.assert(parser.source().contents.len > 0);
|
||||
bun.assert(parser.source().contents.len > 0);
|
||||
|
||||
return try parser.parseExpr(false, true);
|
||||
}
|
||||
@@ -799,7 +799,7 @@ pub fn ParseJSONUTF8AlwaysDecode(
|
||||
.always_decode_escape_sequences = true,
|
||||
}).init(allocator, source.*, log);
|
||||
if (comptime Environment.allow_assert) {
|
||||
std.debug.assert(parser.source().contents.len > 0);
|
||||
bun.assert(parser.source().contents.len > 0);
|
||||
}
|
||||
|
||||
return try parser.parseExpr(false, true);
|
||||
|
||||
Reference in New Issue
Block a user