fix bad great rebase

This commit is contained in:
Karl Seguin
2026-01-16 17:21:36 +08:00
parent 5c1b7935e2
commit 48f07a110f

View File

@@ -93,6 +93,12 @@ pub fn constructor(self: *Caller, comptime T: type, func: anytype, handle: *cons
defer hs.deinit();
const info = FunctionCallbackInfo{ .handle = handle };
if (!info.isConstructCall()) {
self.handleError(T, @TypeOf(func), error.InvalidArgument, info, opts);
return;
}
self._constructor(func, info) catch |err| {
self.handleError(T, @TypeOf(func), err, info, opts);
};
@@ -525,6 +531,10 @@ pub const FunctionCallbackInfo = struct {
v8.v8__FunctionCallbackInfo__GetReturnValue(self.handle, &rv);
return .{ .handle = rv };
}
fn isConstructCall(self: FunctionCallbackInfo) bool {
return v8.v8__FunctionCallbackInfo__IsConstructCall(self.handle);
}
};
pub const PropertyCallbackInfo = struct {