Fix Module::set_indexer_set_fn.

This commit is contained in:
Stephen Chung
2020-07-24 23:16:54 +08:00
parent bff266d4e1
commit 2b0aacde23
4 changed files with 55 additions and 6 deletions

View File

@@ -104,5 +104,19 @@ fn test_function_pointers() -> Result<(), Box<EvalAltResult>> {
42
);
#[cfg(not(feature = "no_object"))]
assert_eq!(
engine.eval::<INT>(
r#"
fn foo(x) { this.data += x; }
let x = #{ data: 40, action: Fn("foo") };
x.action(2);
x.data
"#
)?,
42
);
Ok(())
}