feat: add __lang/rusty_jsc/, build_readme.rs
This commit is contained in:
34
__lang/rusty_jsc/Cargo.lock
generated
Normal file
34
__lang/rusty_jsc/Cargo.lock
generated
Normal file
@@ -0,0 +1,34 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.25"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
|
||||
|
||||
[[package]]
|
||||
name = "rusty_jsc"
|
||||
version = "0.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97f314ea60a5ccbadc997f67a5bca81dc48e7058850e44f05911ce7f22c307de"
|
||||
dependencies = [
|
||||
"rusty_jsc_sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rusty_jsc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"rusty_jsc 0.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rusty_jsc_sys"
|
||||
version = "0.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e139e91ef225f39929b7e8228584500dafd1fa407f2aedd45faa30398f0568c2"
|
||||
dependencies = [
|
||||
"pkg-config",
|
||||
]
|
||||
10
__lang/rusty_jsc/Cargo.toml
Normal file
10
__lang/rusty_jsc/Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "rusty_jsc"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
rusty_jsc = "0.0.1"
|
||||
|
||||
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