diff --git a/builtin_object.go b/builtin_object.go index 45551c52..82da2cf9 100644 --- a/builtin_object.go +++ b/builtin_object.go @@ -274,12 +274,12 @@ func builtinObjectKeys(call FunctionCall) Value { } func builtinObjectValues(call FunctionCall) Value { - if obj, keys := call.Argument(0).object(), []Value(nil); nil != obj { + if obj, values := call.Argument(0).object(), []Value(nil); nil != obj { obj.enumerate(false, func(name string) bool { - keys = append(keys, obj.get(name)) + values = append(values, obj.get(name)) return true }) - return objectValue(call.runtime.newArrayOf(keys)) + return objectValue(call.runtime.newArrayOf(values)) } panic(call.runtime.panicTypeError("Object.Values is nil")) }