Skip to content

Commit

Permalink
Update builtin_object.go
Browse files Browse the repository at this point in the history
Co-authored-by: Steven Hartland <stevenmhartland@gmail.com>
  • Loading branch information
rorymalcolm and stevenh committed Apr 11, 2024
1 parent 4e7db3a commit 728f0da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builtin_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand Down

0 comments on commit 728f0da

Please sign in to comment.