Fix bug on chaining function calls returning shared values.
This commit is contained in:
@@ -652,7 +652,9 @@ impl Engine {
|
||||
_ if is_assignment => unreachable!("cannot assign to an expression"),
|
||||
// {expr}.??? or {expr}[???]
|
||||
expr => {
|
||||
let value = self.eval_expr(scope, global, caches, lib, this_ptr, expr, level)?;
|
||||
let value = self
|
||||
.eval_expr(scope, global, caches, lib, this_ptr, expr, level)?
|
||||
.flatten();
|
||||
let obj_ptr = &mut value.into();
|
||||
let root = ("", expr.start_position());
|
||||
self.eval_dot_index_chain_helper(
|
||||
@@ -1043,6 +1045,11 @@ impl Engine {
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
Dynamic(Union::Shared(..)) => {
|
||||
unreachable!("`get_indexed_mut` cannot handle shared values")
|
||||
}
|
||||
|
||||
_ if use_indexers => self
|
||||
.call_indexer_get(global, caches, lib, target, &mut idx, level)
|
||||
.map(Into::into),
|
||||
|
Reference in New Issue
Block a user