chore: reorg

This commit is contained in:
2020-10-17 11:57:26 +08:00
parent 347ea202e1
commit 5e48a69aa0
74 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
use quick_js::Context;
pub fn main() {
let context = Context::new().unwrap();
let value = context.eval("1 + 2").unwrap();
println!("js: 1 + 2 = {:?}", value);
context
.add_callback("myCallback", |a: i32, b: i32| a + b * b)
.unwrap();
let value = context
.eval(
r#"
var x = myCallback(10, 20);
x;
"#,
)
.unwrap();
println!("js: callback = {:?}", value);
}