Better encapsulate EvalContext.

This commit is contained in:
Stephen Chung
2022-05-17 16:21:17 +08:00
parent 591f7d7362
commit 7c8c6659ae
5 changed files with 64 additions and 77 deletions

View File

@@ -496,15 +496,7 @@ impl Engine {
Some(source.as_str())
};
let context = crate::EvalContext {
engine: self,
scope,
global,
caches: None,
lib,
this_ptr,
level,
};
let context = crate::EvalContext::new(self, scope, global, None, lib, this_ptr, level);
if let Some((.., ref on_debugger)) = self.debugger {
let command = on_debugger(context, event, node, source, node.position())?;