sysjs: improve compatibility with self-hosted compiler

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-20 11:41:28 -07:00
parent 7bc7caaec4
commit 1c43f0f1e8

View file

@ -243,7 +243,10 @@ pub fn createUndefined() Value {
return .{ .tag = .undef, .val = undefined };
}
const FunType = fn (args: Object, args_len: u32, captures: []Value) Value;
const FunType = if (@import("builtin").zig_backend == .stage1)
fn (args: Object, args_len: u32, captures: []Value) Value
else
*const fn (args: Object, args_len: u32, captures: []Value) Value;
var functions: std.ArrayListUnmanaged(FunType) = .{};