zig: make throwTODO use JSError (#15264)

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
This commit is contained in:
Meghan Denny
2024-11-20 15:16:51 -08:00
committed by GitHub
parent 4fe8b71437
commit c9d0fd51a9
9 changed files with 38 additions and 70 deletions

View File

@@ -88,10 +88,10 @@ listHeader += `
`;
zig += `
extern fn Bun__createErrorWithCode(globalThis: *JSC.JSGlobalObject, code: Error, message: *bun.String) JSC.JSValue;
/// Creates an Error object with the given error code.
/// Derefs the message string.
pub fn toJS(this: Error, globalThis: *JSC.JSGlobalObject, message: *bun.String) JSC.JSValue {
@@ -110,7 +110,7 @@ zig += `
}
pub fn throw(this: Error, globalThis: *JSC.JSGlobalObject, comptime fmt_str: [:0]const u8, args: anytype) void {
globalThis.throwValue(fmt(this, globalThis, fmt_str, args));
globalThis.throwValue(fmt(this, globalThis, fmt_str, args));
}
};