Fix bug in try block.

This commit is contained in:
Stephen Chung
2022-01-24 08:34:21 +08:00
parent 922931f51d
commit 8d34ffb9f5
4 changed files with 83 additions and 4 deletions

View File

@@ -29,6 +29,11 @@ fn test_try_catch() -> Result<(), Box<EvalAltResult>> {
123
);
assert_eq!(
engine.eval::<INT>("let x = 42; try { let y = 123; print(x/0); } catch { x = 0 } x")?,
0
);
#[cfg(not(feature = "no_function"))]
assert_eq!(
engine.eval::<INT>(