mirror of
https://github.com/MontFerret/ferret.git
synced 2025-07-15 01:25:00 +02:00
Added .Clone() method to runtime Value
This commit is contained in:
@ -95,6 +95,16 @@ func (t *Array) Hash() int {
|
||||
return out
|
||||
}
|
||||
|
||||
func (t *Array) Clone() core.Value {
|
||||
c := NewArray(len(t.value))
|
||||
|
||||
for _, el := range t.value {
|
||||
c.Push(el)
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (t *Array) Length() Int {
|
||||
return Int(len(t.value))
|
||||
}
|
||||
|
Reference in New Issue
Block a user