1
0
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:
Tim Voronov
2018-09-27 11:53:26 -04:00
parent eeee30856e
commit 69a7295da5
14 changed files with 80 additions and 11 deletions

View File

@ -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))
}