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 {
|
||||
self.set_stack(*reg, StackValue::Value(global));
|
||||
} else {
|
||||
return Err(RuntimeError::GlobalNotFound(
|
||||
constants.get(*global as usize).cloned(),
|
||||
));
|
||||
self.set_stack(*reg, StackValue::Value(Value::Nil));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user