Handle break and return better.

This commit is contained in:
Stephen Chung
2020-03-17 17:33:37 +08:00
parent d2951bfb6b
commit 8efe080412
9 changed files with 242 additions and 142 deletions

View File

@@ -9,6 +9,6 @@ fn test_throw() {
EvalAltResult::ErrorRuntime(s, _) if s == "hello"));
assert!(matches!(
engine.eval::<()>(r#"throw;"#).expect_err("expects error"),
engine.eval::<()>(r#"throw"#).expect_err("expects error"),
EvalAltResult::ErrorRuntime(s, _) if s == ""));
}