Pass level to var resolver.

This commit is contained in:
Stephen Chung
2022-02-04 22:16:12 +08:00
parent 5aee06674f
commit 936dc01e39
3 changed files with 12 additions and 7 deletions

View File

@@ -1230,7 +1230,7 @@ impl Engine {
})?;
let (mut target, _pos) =
self.search_namespace(scope, global, state, lib, this_ptr, first_expr)?;
self.search_namespace(scope, global, state, lib, this_ptr, first_expr, level)?;
if target.as_ref().is_read_only() {
target = target.into_owned();
@@ -1316,8 +1316,9 @@ impl Engine {
})?;
// Get target reference to first argument
let first_arg = &args_expr[0];
let (target, _pos) =
self.search_scope_only(scope, global, state, lib, this_ptr, &args_expr[0])?;
self.search_scope_only(scope, global, state, lib, this_ptr, first_arg, level)?;
#[cfg(not(feature = "unchecked"))]
self.inc_operations(&mut global.num_operations, _pos)?;