fixed mutability
This commit is contained in:
@@ -146,7 +146,11 @@ var Builtins = []struct {
|
||||
|
||||
newElements := make([]Object, length+1, length+1)
|
||||
copy(newElements, arr.Elements)
|
||||
newElements[length] = args[1]
|
||||
if immutable, ok := args[1].(Immutable); ok {
|
||||
newElements[length] = immutable.Clone()
|
||||
} else {
|
||||
newElements[length] = args[1]
|
||||
}
|
||||
|
||||
return &Array{Elements: newElements}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user