feat: add __lang/rusty_jsc/, build_readme.rs

This commit is contained in:
2022-08-28 11:40:00 +08:00
parent 5d1372905f
commit 0b0d4f2f9c
8 changed files with 325 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
use rusty_jsc::JSContext;
fn main() {
let mut context = JSContext::default();
match context.evaluate_script("'hello, world'", 1) {
Some(value) => {
println!("{}", value.to_string(&context));
}
None => {
println!(
"Uncaught: {}",
context.get_exception().unwrap().to_string(&context)
)
}
}
}