Fix tests.
This commit is contained in:
@@ -239,6 +239,17 @@ impl<'a> Target<'a> {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
/// Convert a shared or reference [`Target`] into a target with an owned value.
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn into_owned(self) -> Self {
|
||||
match self {
|
||||
Self::RefMut(r) => Self::TempValue(r.clone()),
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
Self::SharedValue { value, .. } => Self::TempValue(value),
|
||||
_ => self,
|
||||
}
|
||||
}
|
||||
/// Get the source [`Dynamic`] of the [`Target`].
|
||||
#[allow(dead_code)]
|
||||
#[inline]
|
||||
|
@@ -1234,9 +1234,13 @@ impl Engine {
|
||||
.map(|(value, ..)| arg_values.push(value.flatten()))
|
||||
})?;
|
||||
|
||||
let (target, _pos) =
|
||||
let (mut target, _pos) =
|
||||
self.search_namespace(scope, global, lib, this_ptr, first_expr, level)?;
|
||||
|
||||
if target.is_read_only() {
|
||||
target = target.into_owned();
|
||||
}
|
||||
|
||||
self.track_operation(global, _pos)?;
|
||||
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
|
Reference in New Issue
Block a user