Make non-existant globals return nil
This commit is contained in:
parent
5246028c90
commit
cc943915b2
@ -558,9 +558,7 @@ impl<UserData: Clone> ClosureRunner<UserData> {
|
|||||||
if let Some(global) = glob {
|
if let Some(global) = glob {
|
||||||
self.set_stack(*reg, StackValue::Value(global));
|
self.set_stack(*reg, StackValue::Value(global));
|
||||||
} else {
|
} else {
|
||||||
return Err(RuntimeError::GlobalNotFound(
|
self.set_stack(*reg, StackValue::Value(Value::Nil));
|
||||||
constants.get(*global as usize).cloned(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user