vm: make REVERSE work with structs

Also add more tests.
Extend `Array` method of `Element` to work with `StructItem`.
This commit is contained in:
Evgenii Stratonikov 2019-09-12 16:54:22 +03:00
parent f0426ac2d5
commit fd264cb06f
2 changed files with 31 additions and 0 deletions

View file

@ -121,6 +121,8 @@ func (e *Element) Array() []StackItem {
switch t := e.value.(type) {
case *ArrayItem:
return t.value
case *StructItem:
return t.value
default:
panic("element is not an array")
}