feat: add __lang/rusty_jsc/, build_readme.rs
This commit is contained in:
17
__lang/rusty_jsc/src/main.rs
Normal file
17
__lang/rusty_jsc/src/main.rs
Normal 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)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user