feat: add boa

This commit is contained in:
2021-01-02 18:33:38 +08:00
parent d7488c82d7
commit 257906518e
3 changed files with 396 additions and 0 deletions

14
__lang/boa/src/main.rs Normal file
View File

@@ -0,0 +1,14 @@
use boa::Context;
fn main() {
let mut context = Context::new();
let script = r##"
function helloworld() {
console.log('hello world');
}
helloworld();
"hello world!!!"
"##;
let v = context.eval(script).expect("Eval failed!");
println!("{:?}", v);
}