This commit is contained in:
Stephen Chung
2022-07-20 21:09:03 +08:00
18 changed files with 42 additions and 47 deletions

View File

@@ -190,7 +190,7 @@ impl<'a, 's, 'ps, 'g, 'pg, 'c, 'pc, 't, 'pt> EvalContext<'a, 's, 'ps, 'g, 'pg, '
caches,
self.lib,
self.this_ptr,
&statements,
statements,
rewind_scope,
self.level,
),

View File

@@ -99,7 +99,7 @@ impl Engine {
let mut target: Target = value.clone().into();
// Module variables are constant
target.set_access_mode(AccessMode::ReadOnly);
return Ok((target.into(), *_var_pos));
return Ok((target, *_var_pos));
}
}
@@ -518,6 +518,6 @@ impl Engine {
#[cfg(feature = "debugging")]
global.debugger.reset_status(reset_debugger);
return result;
result
}
}

View File

@@ -161,7 +161,7 @@ impl Engine {
) {
Ok(_) => {
#[cfg(not(feature = "unchecked"))]
self.check_data_size(&args[0], root.1)?;
self.check_data_size(args[0], root.1)?;
}
Err(err) if matches!(*err, ERR::ErrorFunctionNotFound(ref f, ..) if f.starts_with(op_assign)) =>
{
@@ -577,7 +577,7 @@ impl Engine {
}
let condition = self
.eval_expr(scope, global, caches, lib, this_ptr, &expr, level)
.eval_expr(scope, global, caches, lib, this_ptr, expr, level)
.and_then(|v| {
v.as_bool().map_err(|typ| {
self.make_type_mismatch_err::<bool>(typ, expr.position())
@@ -943,7 +943,7 @@ impl Engine {
}
let path_result = self
.eval_expr(scope, global, caches, lib, this_ptr, &expr, level)
.eval_expr(scope, global, caches, lib, this_ptr, expr, level)
.and_then(|v| {
let typ = v.type_name();
v.try_cast::<crate::ImmutableString>().ok_or_else(|| {
@@ -1036,6 +1036,6 @@ impl Engine {
#[cfg(feature = "debugging")]
global.debugger.reset_status(reset_debugger);
return result;
result
}
}