Skip to content

Commit 7da2259

Browse files
committed
add castToModule to persistent
1 parent 0c7e648 commit 7da2259

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/v8.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,13 @@ pub fn Persistent(comptime T: type) type {
936936
};
937937
}
938938

939+
/// Should only be called if you know the underlying type is a v8.Module.
940+
pub fn castToModule(self: Self) Module {
941+
return .{
942+
.handle = @as(*const c.Module, @ptrCast(self.handle)),
943+
};
944+
}
945+
939946
/// Should only be called if you know the underlying type is a v8.PromiseResolver.
940947
pub fn castToPromiseResolver(self: Self) PromiseResolver {
941948
return .{

0 commit comments

Comments
 (0)