Fix for loop operations.
This commit is contained in:
parent
3c7cd8e278
commit
3d06ddc6e2
@ -686,6 +686,11 @@ impl Engine {
|
|||||||
|
|
||||||
let mut result = Dynamic::UNIT;
|
let mut result = Dynamic::UNIT;
|
||||||
|
|
||||||
|
if body.is_empty() {
|
||||||
|
for _ in iter_func(iter_obj) {
|
||||||
|
self.track_operation(global, body.position())?;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
for (x, iter_value) in iter_func(iter_obj).enumerate() {
|
for (x, iter_value) in iter_func(iter_obj).enumerate() {
|
||||||
// Increment counter
|
// Increment counter
|
||||||
if let Some(counter_index) = counter_index {
|
if let Some(counter_index) = counter_index {
|
||||||
@ -715,10 +720,6 @@ impl Engine {
|
|||||||
*scope.get_mut_by_index(index).write_lock().unwrap() = value;
|
*scope.get_mut_by_index(index).write_lock().unwrap() = value;
|
||||||
|
|
||||||
// Run block
|
// Run block
|
||||||
if body.is_empty() {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let this_ptr = this_ptr.as_deref_mut();
|
let this_ptr = this_ptr.as_deref_mut();
|
||||||
|
|
||||||
match self.eval_stmt_block(global, caches, scope, this_ptr, body, true) {
|
match self.eval_stmt_block(global, caches, scope, this_ptr, body, true) {
|
||||||
@ -733,6 +734,7 @@ impl Engine {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user