deno_core Extension with Global Access
Is there a way to make a Deno Extension be accessed by
Extension.op() instead of Deno.core.ops.op()?deno_core::JsRuntime::execute_scriptconsolefetch99_main.jswindow.__bootstrapdeno_runtimedeno_runtimedeno_runtimeglobalThisWorkerOptionsstartup_snapshotwindow.__bootstrap.globalScope.windowOrWorkerGlobalScope.myThing = myThingdeno_runtime::js::get_99_main()deno_core::snapshot_util::CreateSnapshotOptionsextensions_with_jserror: failed to run custom build command for `runtime v0.1.0 (/workspaces/runtime)`
Caused by:
process didn't exit successfully: `/workspaces/runtime/target/debug/build/runtime-7279b5b14e8d927f/build-script-build` (signal: 5, SIGTRAP: trace/breakpoint trap)
--- stderr
Unknown external reference 0x21.
<unresolved>Extension.depends_on(&["name1", "name2"])const Extension = Deno.core.ops
Extension.op()use deno_core::snapshot_util;
use std::path::PathBuf;
fn main() {
let snapshot_path = PathBuf::from(std::env::var_os("OUT_DIR").unwrap()).join("EVO_SNAPSHOT.bin");
create_snapshot(snapshot_path.clone());
println!("cargo:rustc-env=EVO_SNAPSHOT_PATH={}", snapshot_path.to_str().unwrap());
}
fn create_snapshot(snapshot_path: PathBuf) {
snapshot_util::create_snapshot(snapshot_util::CreateSnapshotOptions {
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
snapshot_path,
startup_snapshot: Some(deno_runtime::js::deno_isolate_init()),
extensions: vec![],
extensions_with_js: vec![],
additional_files: vec![deno_runtime::js::get_99_main()],
compression_cb: None,
});
}