mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +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:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user