Refactor Zig imports and file structure (part 1) (#21270)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
taylor.fish
2025-07-22 17:51:38 -07:00
committed by GitHub
parent 73d92c7518
commit 07cd45deae
564 changed files with 9917 additions and 9697 deletions

View File

@@ -1,24 +1,25 @@
pub const ERR_INVALID_HANDLE_TYPE = createSimpleError(createTypeError, .ERR_INVALID_HANDLE_TYPE, "This handle type cannot be sent");
pub const ERR_CHILD_CLOSED_BEFORE_REPLY = createSimpleError(createError, .ERR_CHILD_CLOSED_BEFORE_REPLY, "Child closed before reply received");
fn createSimpleError(comptime createFn: anytype, comptime code: JSC.Node.ErrorCode, comptime message: string) JSC.JS2NativeFunctionType {
fn createSimpleError(comptime createFn: anytype, comptime code: jsc.Node.ErrorCode, comptime message: string) jsc.JS2NativeFunctionType {
const R = struct {
pub fn cbb(global: *JSC.JSGlobalObject) bun.JSError!JSC.JSValue {
pub fn cbb(global: *jsc.JSGlobalObject) bun.JSError!jsc.JSValue {
const S = struct {
fn cb(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSError!JSC.JSValue {
fn cb(globalThis: *jsc.JSGlobalObject, callframe: *jsc.CallFrame) bun.JSError!jsc.JSValue {
_ = callframe;
return createFn(globalThis, code, message, .{});
}
};
return JSC.JSFunction.create(global, @tagName(code), S.cb, 0, .{});
return jsc.JSFunction.create(global, @tagName(code), S.cb, 0, .{});
}
};
return R.cbb;
}
const bun = @import("bun");
const JSC = bun.JSC;
const string = bun.string;
const string = []const u8;
const createError = JSC.JSGlobalObject.createErrorInstanceWithCode;
const createTypeError = JSC.JSGlobalObject.createTypeErrorInstanceWithCode;
const bun = @import("bun");
const jsc = bun.jsc;
const createError = jsc.JSGlobalObject.createErrorInstanceWithCode;
const createTypeError = jsc.JSGlobalObject.createTypeErrorInstanceWithCode;