Fix bug in catch error variable.

This commit is contained in:
Stephen Chung
2021-09-03 10:05:58 +08:00
parent 2980683153
commit 71711998f1
3 changed files with 23 additions and 3 deletions

View File

@@ -51,6 +51,18 @@ fn test_try_catch() -> Result<(), Box<EvalAltResult>> {
42
);
assert_eq!(
engine.eval::<INT>(
"
let err = 123;
let x = 0;
try { throw 42; } catch(err) { print(err); }
err
"
)?,
123
);
assert_eq!(
engine.eval::<INT>(
"