We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd1dead commit 5906b85Copy full SHA for 5906b85
v8.go
@@ -64,18 +64,10 @@ func (f V8Function) Call(args ...interface{}) (interface{}, error) {
64
})
65
arguments.WriteString("(" + buf.String() + ")")
66
} else {
67
- if obj, ok := arg.(V8Object); ok {
68
- arguments.WriteString(obj.Name)
69
- } else if num, ok := arg.(float64); ok {
70
- arguments.WriteString(fmt.Sprintf("%v", num))
71
- } else if bln, ok := arg.(bool); ok {
72
- if bln {
73
- arguments.WriteString("true")
74
- } else {
75
- arguments.WriteString("false")
76
- }
77
- } else if str, ok := arg.(string); ok {
78
- arguments.WriteString(str)
+ if v8obj, ok := arg.(V8Object); ok {
+ arguments.WriteString(v8obj.Name)
+ } else {
+ json.NewEncoder(&arguments).Encode(arg)
79
}
80
81
if i != len(args)-1 {
0 commit comments