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

@@ -1741,7 +1741,7 @@ pub const ${className(typeName)} = struct {
JSC.markBinding(@src());
if (comptime Environment.allow_assert) {
const value__ = ${symbolName(typeName, "create")}(globalObject, this);
std.debug.assert(value__.as(${typeName}).? == this); // If this fails, likely a C ABI issue.
@import("root").bun.assert(value__.as(${typeName}).? == this); // If this fails, likely a C ABI issue.
return value__;
} else {
return ${symbolName(typeName, "create")}(globalObject, this);
@@ -1759,7 +1759,7 @@ pub const ${className(typeName)} = struct {
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *${typeName}, value: JSC.JSValue) void {
JSC.markBinding(@src());
std.debug.assert(${symbolName(typeName, "dangerouslySetPtr")}(value, null));
bun.assert(${symbolName(typeName, "dangerouslySetPtr")}(value, null));
}
extern fn ${symbolName(typeName, "fromJS")}(JSC.JSValue) ?*${typeName};