Refactor and add state to debugger.

This commit is contained in:
Stephen Chung
2022-01-28 18:59:18 +08:00
parent 20baae71d4
commit 66af69aaff
30 changed files with 693 additions and 624 deletions

View File

@@ -74,7 +74,7 @@ impl Engine {
#[cfg(feature = "debugging")]
#[cfg(not(feature = "no_function"))]
let orig_call_stack_len = global.debugger.call_stack_len();
let orig_call_stack_len = global.debugger.call_stack().len();
// Put arguments into scope as variables
scope.extend(fn_def.params.iter().cloned().zip(args.into_iter().map(|v| {
@@ -115,10 +115,9 @@ impl Engine {
#[cfg(not(feature = "no_module"))]
if let Some(ref modules) = fn_def.global {
modules
.iter()
.cloned()
.for_each(|(n, m)| global.push_import(n, m));
for (n, m) in modules.iter().cloned() {
global.push_import(n, m)
}
}
// Evaluate the function