diff options
Diffstat (limited to 'vendor/github.com/robertkrimen/otto/builtin_string.go')
-rw-r--r-- | vendor/github.com/robertkrimen/otto/builtin_string.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/robertkrimen/otto/builtin_string.go b/vendor/github.com/robertkrimen/otto/builtin_string.go index f5f09fee1..6a1718458 100644 --- a/vendor/github.com/robertkrimen/otto/builtin_string.go +++ b/vendor/github.com/robertkrimen/otto/builtin_string.go @@ -380,7 +380,12 @@ func builtinString_split(call FunctionCall) Value { split = split[:limit] } - return call.runtime.toValue(split) + valueArray := make([]Value, len(split)) + for index, value := range split { + valueArray[index] = toValue_string(value) + } + + return toValue_object(call.runtime.newArrayOf(valueArray)) } } |