Fix no_module build.
This commit is contained in:
parent
38e47c909d
commit
71e475be13
@ -493,6 +493,7 @@ impl fmt::Debug for Expr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
f.write_str(&x.3)?;
|
f.write_str(&x.3)?;
|
||||||
|
#[cfg(not(feature = "no_module"))]
|
||||||
if let Some(n) = x.1.index() {
|
if let Some(n) = x.1.index() {
|
||||||
write!(f, " #{}", n)?;
|
write!(f, " #{}", n)?;
|
||||||
}
|
}
|
||||||
|
@ -1137,27 +1137,25 @@ impl Engine {
|
|||||||
KEYWORD_EVAL if total_args == 1 => {
|
KEYWORD_EVAL if total_args == 1 => {
|
||||||
// eval - only in function call style
|
// eval - only in function call style
|
||||||
let orig_scope_len = scope.len();
|
let orig_scope_len = scope.len();
|
||||||
|
#[cfg(not(feature = "no_module"))]
|
||||||
let orig_imports_len = global.num_imports();
|
let orig_imports_len = global.num_imports();
|
||||||
let arg = first_arg.unwrap();
|
let arg = first_arg.unwrap();
|
||||||
let (arg_value, pos) =
|
let (arg_value, pos) =
|
||||||
self.get_arg_value(scope, global, caches, lib, this_ptr, arg, level)?;
|
self.get_arg_value(scope, global, caches, lib, this_ptr, arg, level)?;
|
||||||
let script = &arg_value
|
let s = &arg_value
|
||||||
.into_immutable_string()
|
.into_immutable_string()
|
||||||
.map_err(|typ| self.make_type_mismatch_err::<ImmutableString>(typ, pos))?;
|
.map_err(|typ| self.make_type_mismatch_err::<ImmutableString>(typ, pos))?;
|
||||||
let result = self.eval_script_expr_in_place(
|
let result =
|
||||||
scope,
|
self.eval_script_expr_in_place(scope, global, caches, lib, s, pos, level + 1);
|
||||||
global,
|
|
||||||
caches,
|
|
||||||
lib,
|
|
||||||
script,
|
|
||||||
pos,
|
|
||||||
level + 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
// IMPORTANT! If the eval defines new variables in the current scope,
|
// IMPORTANT! If the eval defines new variables in the current scope,
|
||||||
// all variable offsets from this point on will be mis-aligned.
|
// all variable offsets from this point on will be mis-aligned.
|
||||||
// The same is true for imports.
|
// The same is true for imports.
|
||||||
if scope.len() != orig_scope_len || global.num_imports() != orig_imports_len {
|
let scope_changed = scope.len() != orig_scope_len;
|
||||||
|
#[cfg(not(feature = "no_module"))]
|
||||||
|
let scope_changed = scope_changed || global.num_imports() != orig_imports_len;
|
||||||
|
|
||||||
|
if scope_changed {
|
||||||
global.always_search_scope = true;
|
global.always_search_scope = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ impl CallableFunction {
|
|||||||
Self::Script(..) => None,
|
Self::Script(..) => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Create a new [`CallableFunction::Method`] from a [built-in function][`FnBuiltin`].
|
/// Create a new [`CallableFunction::Method`] from a built-in function.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn from_fn_builtin(func: FnBuiltin) -> Self {
|
pub fn from_fn_builtin(func: FnBuiltin) -> Self {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user