fix: Call FromJSValue using the correct parameter

reflect_from
Chan Wen Xu 2021-03-22 22:22:07 +07:00
parent 8eadf27091
commit 421c331333
Signed by: chanbakjsd
GPG Key ID: 7E9A74B1B07A7558
1 changed files with 3 additions and 3 deletions

@ -83,13 +83,13 @@ func conformJSValueToType(funcType reflect.Type, this js.Value, values []js.Valu
in := make([]reflect.Value, 0, len(values)) in := make([]reflect.Value, 0, len(values))
for i, v := range values { for i, v := range values {
paramType := funcType.In(i) paramType := funcType.In(i)
x := reflect.Zero(paramType).Interface() ptrX := reflect.New(paramType).Interface()
err := FromJSValue(v, &x) err := FromJSValue(v, ptrX)
if err != nil { if err != nil {
return nil, err return nil, err
} }
in = append(in, reflect.ValueOf(x)) in = append(in, reflect.ValueOf(ptrX).Elem())
} }
return in, nil return in, nil