85 个版本 (32 个破坏性更新)

0.32.1 2021年10月27日
0.31.0 2021年10月4日
0.25.3 2021年7月12日
0.21.0 2021年3月9日
0.0.6 2019年11月30日

#28 in #v8

Download history 351/week @ 2024-03-11 425/week @ 2024-03-18 168/week @ 2024-03-25 475/week @ 2024-04-01 261/week @ 2024-04-08 282/week @ 2024-04-15 276/week @ 2024-04-22 284/week @ 2024-04-29 170/week @ 2024-05-06 231/week @ 2024-05-13 387/week @ 2024-05-20 404/week @ 2024-05-27 307/week @ 2024-06-03 245/week @ 2024-06-10 201/week @ 2024-06-17 237/week @ 2024-06-24

1,100 每月下载量
用于 22 个 crate (7 直接)

MIT 许可证

46MB
1M SLoC

C++ 1M SLoC // 0.1% comments Python 23K SLoC // 0.3% comments C 16K SLoC // 0.2% comments Rust 12K SLoC // 0.0% comments Shell 3.5K SLoC // 0.2% comments Bazel 3.5K SLoC // 0.0% comments Perl 471 SLoC // 0.3% comments Bitbake 157 SLoC GNU Style Assembly 126 SLoC WebAssembly 109 SLoC TypeScript 82 SLoC // 0.1% comments Java 44 SLoC // 0.3% comments Batch 34 SLoC // 0.3% comments Forge Config 20 SLoC Objective-C++ 6 SLoC // 0.6% comments

包含 (自动工具混淆代码,275KB) third_party/icu/source/configure,(ELF 可执行文件/库,115KB) eu-strip,(混乱的自动配置代码,48KB) third_party/icu/source/configure.ac

Rusty V8

Rusty V8 crate 现在以 v8 crate 名称发布:https://crates.io/crates/v8

将不再发布到 https://crates.io/crates/rusty_v8

请更新您的 Cargo.toml 文件!


lib.rs:

示例

use rusty_v8 as v8;

let platform = v8::new_default_platform(0, false).make_shared();
v8::V8::initialize_platform(platform);
v8::V8::initialize();

let isolate = &mut v8::Isolate::new(Default::default());

let scope = &mut v8::HandleScope::new(isolate);
let context = v8::Context::new(scope);
let scope = &mut v8::ContextScope::new(scope, context);

let code = v8::String::new(scope, "'Hello' + ' World!'").unwrap();
println!("javascript code: {}", code.to_rust_string_lossy(scope));

let script = v8::Script::compile(scope, code, None).unwrap();
let result = script.run(scope).unwrap();
let result = result.to_string(scope).unwrap();
println!("result: {}", result.to_rust_string_lossy(scope));

依赖项