Skip to content

Commit 2698a33

Browse files
committed
Persist more types
1 parent 5d46f15 commit 2698a33

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/v8.zig

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,23 @@ pub fn Persistent(comptime T: type) type {
934934
};
935935
}
936936

937+
pub fn castToFunctionTemplate(self: Self) FunctionTemplate {
938+
return .{
939+
.handle = @as(*const c.FunctionTemplate, @ptrCast(self.handle)),
940+
};
941+
}
942+
pub fn castToObjectTemplate(self: Self) ObjectTemplate {
943+
return .{
944+
.handle = @as(*const c.ObjectTemplate, @ptrCast(self.handle)),
945+
};
946+
}
947+
948+
pub fn castToContext(self: Self) Context {
949+
return .{
950+
.handle = @as(*const c.Context, @ptrCast(self.handle)),
951+
};
952+
}
953+
937954
pub fn toValue(self: Self) Value {
938955
return .{
939956
.handle = self.handle,
@@ -2068,7 +2085,7 @@ pub const Value = struct {
20682085
}
20692086

20702087
pub fn isBigUint64Array(self: Self) bool {
2071-
return c.v8__Value__IsBigUint64Array (self.handle);
2088+
return c.v8__Value__IsBigUint64Array(self.handle);
20722089
}
20732090

20742091
pub fn isFloat32Array(self: Self) bool {

0 commit comments

Comments
 (0)