Minor cleanup.

This commit is contained in:
Stephen Chung
2022-12-09 20:42:55 +08:00
parent 30ff208104
commit f15a9a7c9c
9 changed files with 41 additions and 38 deletions

View File

@@ -392,13 +392,19 @@ impl Engine {
self.run_debugger(global, caches, scope, this_ptr, lhs)?;
self.track_operation(global, *var_pos)?;
let mut target = self.search_namespace(global, caches, scope, this_ptr, lhs)?;
let obj_ptr = &mut target;
let mut this = Dynamic::NULL;
let target = &mut self.search_namespace(global, caches, scope, this_ptr, lhs)?;
let mut this_ptr = Dynamic::NULL;
self.eval_dot_index_chain_raw(
global, caches, &mut this, lhs, expr, obj_ptr, rhs, idx_values, new_val,
global,
caches,
&mut this_ptr,
lhs,
expr,
target,
rhs,
idx_values,
new_val,
)
}
// {expr}.??? = ??? or {expr}[???] = ???

View File

@@ -882,9 +882,9 @@ impl Engine {
scope: &mut Scope,
statements: &[Stmt],
) -> RhaiResult {
let mut this = Dynamic::NULL;
let mut this_ptr = Dynamic::NULL;
self.eval_stmt_block(global, caches, scope, &mut this, statements, false)
self.eval_stmt_block(global, caches, scope, &mut this_ptr, statements, false)
.or_else(|err| match *err {
ERR::Return(out, ..) => Ok(out),
ERR::LoopBreak(..) => {