From a1dc55be6e695a1c04e5e9e0f1ce7406a5dd3dff Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Thu, 15 Oct 2026 11:25:14 +0200 Subject: add function struct to register js functions dynamically --- src/zilch/Env/Function.zig | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/zilch/Env/Function.zig (limited to 'src/zilch/Env/Function.zig') diff --git a/src/zilch/Env/Function.zig b/src/zilch/Env/Function.zig new file mode 100644 index 0000000..692ce2b --- /dev/null +++ b/src/zilch/Env/Function.zig @@ -0,0 +1,13 @@ +const std = @import("std"); + +const Self = @This(); + +content: []const u8, +id: u32, + +pub fn from(content: []const u8) Self { + return .{ + .content = content, + .id = std.hash.XxHash32.hash(4654, content), + }; +} -- cgit v1.2.3-70-g09d2