From 5ec478b5fa6261e2b2d3c8daed3cba9e780730c7 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Fri, 30 Apr 2021 16:38:35 +0200 Subject: refactor(core): initialize extensions in runtime constructor (#10421) This ensures that provided extensions are all correctly setup and ready to use once the JsRuntime constructor returns Note: this will also initialize ops for to-be-snapshotted runtimes --- runtime/build.rs | 2 -- runtime/web_worker.rs | 2 -- runtime/worker.rs | 2 -- 3 files changed, 6 deletions(-) (limited to 'runtime') diff --git a/runtime/build.rs b/runtime/build.rs index 591ebaab7..b6a9da582 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -14,8 +14,6 @@ fn create_snapshot( snapshot_path: &Path, files: Vec, ) { - js_runtime.init_extension_js().unwrap(); - // TODO(nayeemrmn): https://github.com/rust-lang/cargo/issues/3946 to get the // workspace root. let display_root = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap(); diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index 5feb0212c..7f0a4885f 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -253,8 +253,6 @@ impl WebWorker { }); } - js_runtime.init_extension_ops().unwrap(); - ops::web_worker::init(js_runtime, sender.clone(), handle); ops::runtime::init(js_runtime, main_module); ops::worker_host::init( diff --git a/runtime/worker.rs b/runtime/worker.rs index fddaf1f01..c2e241169 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -140,8 +140,6 @@ impl MainWorker { }); } - js_runtime.init_extension_ops().unwrap(); - ops::runtime::init(js_runtime, main_module); ops::worker_host::init( js_runtime, -- cgit v1.2.3