From 343d985e967ce808c44f3bdc2f5210d4cc08e592 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Tue, 10 Mar 2026 15:40:18 +0800 Subject: [PATCH] Better support for variadic js.Value parameter (e.g. console.log) The bridge will prefer to map a Zig array to a JS Array, but in the case of a []js.Value, it should be willing to map anything into it. --- src/browser/js/Caller.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/js/Caller.zig b/src/browser/js/Caller.zig index 01adc4f2..297d4ac1 100644 --- a/src/browser/js/Caller.zig +++ b/src/browser/js/Caller.zig @@ -734,7 +734,7 @@ fn getArgs(comptime F: type, comptime offset: usize, local: *const Local, info: if (last_parameter_type_info == .pointer and last_parameter_type_info.pointer.size == .slice) { const slice_type = last_parameter_type_info.pointer.child; const corresponding_js_value = info.getArg(@intCast(last_js_parameter), local); - if (corresponding_js_value.isArray() == false and corresponding_js_value.isTypedArray() == false and slice_type != u8) { + if (slice_type == js.Value or (corresponding_js_value.isArray() == false and corresponding_js_value.isTypedArray() == false and slice_type != u8)) { is_variadic = true; if (js_parameter_count == 0) { @field(args, tupleFieldName(params_to_map.len + offset - 1)) = &.{};