Closed yinxulai closed 2 months ago
Reproduce code
func TestRestParams(t *testing.T) { vm := goja.New() console.Enable(vm) vm.RunString(` function test(...params) { console.log(...params) } `) var test func (params ...any) any vm.ExportTo(vm.Get("test"), &test) test(1,2,3,4) } // output: // Expected: 1,2,3,4 // Actual: [1,2,3,4]
It looks like goja will pass the go rest parameters as an array to the js function
Thanks for reporting. There is even an Example, but the way it was written just masked the issue.
Can you open your github sponsors? Mybe i want buy you a drink.
Reproduce code
It looks like goja will pass the go rest parameters as an array to the js function