mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 03:48:56 +00:00
allow zig js host functions to return JSError (#15120)
This commit is contained in:
@@ -14,9 +14,9 @@ pub const ERR_CHILD_CLOSED_BEFORE_REPLY = createSimpleError(createError, .ERR_CH
|
||||
|
||||
fn createSimpleError(comptime createFn: anytype, comptime code: JSC.Node.ErrorCode, comptime message: string) JSC.JS2NativeFunctionType {
|
||||
const R = struct {
|
||||
pub fn cbb(global: *JSC.JSGlobalObject) callconv(JSC.conv) JSC.JSValue {
|
||||
pub fn cbb(global: *JSC.JSGlobalObject) bun.JSError!JSC.JSValue {
|
||||
const S = struct {
|
||||
fn cb(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(JSC.conv) JSC.JSValue {
|
||||
fn cb(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSError!JSC.JSValue {
|
||||
_ = callframe;
|
||||
return createFn(globalThis, code, message, .{});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user