This commit is contained in:
Stephen Chung
2022-11-10 14:25:48 +08:00
parent 54353c6676
commit 013ee223ee
10 changed files with 87 additions and 43 deletions

View File

@@ -141,8 +141,9 @@ impl Engine {
// Built-in found
let op = op_assign_token.literal_syntax();
let orig_level = global.level;
global.level += 1;
let global = &*RestoreOnDrop::lock(global, move |g| g.level -= 1);
let global = &*RestoreOnDrop::lock(global, move |g| g.level = orig_level);
let context = (self, op, None, global, *op_pos).into();
return func(context, args).map(|_| ());