forked from TrueCloudLab/neoneo-go
vm: make REVERSE work with structs
Also add more tests. Extend `Array` method of `Element` to work with `StructItem`.
This commit is contained in:
parent
f0426ac2d5
commit
fd264cb06f
2 changed files with 31 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue