diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-15 11:25:14 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-15 11:25:14 +0200 |
| commit | a1dc55be6e695a1c04e5e9e0f1ce7406a5dd3dff (patch) | |
| tree | 46e78cce4fcc9ec7f04b3ae69bf53d9a81710dbe /src/zilch/Env/Function.zig | |
| parent | 0b2af471b6d5dfc4eaf53639102c1b854bbb324b (diff) | |
add function struct to register js functions dynamically
Diffstat (limited to 'src/zilch/Env/Function.zig')
| -rw-r--r-- | src/zilch/Env/Function.zig | 13 |
1 files changed, 13 insertions, 0 deletions
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), + }; +} |