Refine error display.

This commit is contained in:
Stephen Chung
2022-11-27 18:00:02 +08:00
parent 549193f49b
commit fcc7589ffc
7 changed files with 82 additions and 93 deletions

View File

@@ -127,9 +127,13 @@ impl Engine {
}
let statements = ast.statements();
if !statements.is_empty() {
self.eval_global_statements(global, caches, scope, statements)?;
}
let result = if !statements.is_empty() {
self.eval_global_statements(global, caches, scope, statements)
.map(|_| ())
} else {
Ok(())
};
#[cfg(feature = "debugging")]
if self.is_debugger_registered() {
@@ -139,7 +143,7 @@ impl Engine {
self.run_debugger(global, caches, scope, &mut this, node)?;
}
Ok(())
result
}
}