OOP support.

This commit is contained in:
Stephen Chung
2020-06-26 10:39:18 +08:00
parent 259b6d0fcf
commit 175c3ccaec
27 changed files with 498 additions and 234 deletions

View File

@@ -39,9 +39,9 @@ fn test_bool_op_short_circuit() -> Result<(), Box<EvalAltResult>> {
assert_eq!(
engine.eval::<bool>(
r"
let this = true;
let x = true;
this || { throw; };
x || { throw; };
"
)?,
true
@@ -50,9 +50,9 @@ fn test_bool_op_short_circuit() -> Result<(), Box<EvalAltResult>> {
assert_eq!(
engine.eval::<bool>(
r"
let this = false;
let x = false;
this && { throw; };
x && { throw; };
"
)?,
false
@@ -68,9 +68,9 @@ fn test_bool_op_no_short_circuit1() {
assert!(engine
.eval::<bool>(
r"
let this = true;
let x = true;
this | { throw; }
x | { throw; }
"
)
.is_err());
@@ -83,9 +83,9 @@ fn test_bool_op_no_short_circuit2() {
assert!(engine
.eval::<bool>(
r"
let this = false;
let x = false;
this & { throw; }
x & { throw; }
"
)
.is_err());