feat: rm run_js
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
mod qjs;
|
||||
mod sig;
|
||||
|
||||
@@ -9,9 +7,6 @@ pub use sig::*; // TODO
|
||||
fn main() {
|
||||
let context = QuickJSContext::new().unwrap();
|
||||
|
||||
let mut map = HashMap::new();
|
||||
map.insert("name", "hatter");
|
||||
|
||||
let script = r##"
|
||||
function __EXPORT(f) { eval('__PUBLIC_' + f + '=' + f); }
|
||||
|
||||
@@ -36,8 +31,10 @@ fn main() {
|
||||
"##;
|
||||
|
||||
context.init(script).unwrap();
|
||||
let r = context.run_js(&map);
|
||||
println!("{:?}", r);
|
||||
// let mut map = HashMap::new();
|
||||
// map.insert("name", "hatter");
|
||||
// let r = context.run_js(&map);
|
||||
// println!("{:?}", r);
|
||||
let r = context.call_fn("getName", "[1, 'hatter', 'jiang']");
|
||||
println!("{:?}", r);
|
||||
let r = context.call_fn("helloAb", "['hatter', 'jiang']");
|
||||
|
||||
Reference in New Issue
Block a user