mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
allow zig js host functions to return JSError (#15120)
This commit is contained in:
@@ -1094,7 +1094,7 @@ const PatchLinesParser = struct {
|
||||
};
|
||||
|
||||
pub const TestingAPIs = struct {
|
||||
pub fn makeDiff(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) JSC.JSValue {
|
||||
pub fn makeDiff(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSError!JSC.JSValue {
|
||||
const arguments_ = callframe.arguments(2);
|
||||
var arguments = JSC.Node.ArgumentsSlice.init(globalThis.bunVM(), arguments_.slice());
|
||||
|
||||
@@ -1146,7 +1146,7 @@ pub const TestingAPIs = struct {
|
||||
}
|
||||
}
|
||||
};
|
||||
pub fn apply(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) JSC.JSValue {
|
||||
pub fn apply(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSError!JSC.JSValue {
|
||||
var args = switch (parseApplyArgs(globalThis, callframe)) {
|
||||
.err => |e| return e,
|
||||
.result => |a| a,
|
||||
@@ -1161,7 +1161,7 @@ pub const TestingAPIs = struct {
|
||||
return .true;
|
||||
}
|
||||
/// Used in JS tests, see `internal-for-testing.ts` and patch tests.
|
||||
pub fn parse(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) JSC.JSValue {
|
||||
pub fn parse(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSError!JSC.JSValue {
|
||||
const arguments_ = callframe.arguments(2);
|
||||
var arguments = JSC.Node.ArgumentsSlice.init(globalThis.bunVM(), arguments_.slice());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user