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

@@ -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);