Allow for functions to be called after a variable is pushed to the stack
This commit is contained in:
parent
cf8268a4d7
commit
cedad9d472
1 changed files with 5 additions and 1 deletions
|
|
@ -564,7 +564,11 @@ func (vm *VM) addVar(name string, value Value) {
|
|||
|
||||
func (vm *VM) getVar(name string) *VariableValue {
|
||||
for i := vm.variableEnd - 1; i >= 0; i-- {
|
||||
v := vm.stack.items[i].(*VariableValue)
|
||||
v, ok := vm.stack.items[i].(*VariableValue)
|
||||
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
if v.name == name {
|
||||
return v
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue