summaryrefslogtreecommitdiff
path: root/cli/ops/runtime.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-09-28 12:14:11 +0200
committerGitHub <noreply@github.com>2020-09-28 12:14:11 +0200
commit45d4fd44c9444241a898d3075b99e8871fccdd65 (patch)
treec6ac6bb880023326e935f96d56ef23ba891f92d3 /cli/ops/runtime.rs
parent8ceb165e5d1dc0c8d417e42ffc3a26e8f5a62a03 (diff)
refactor: move op state registration to workers (#7696)
Diffstat (limited to 'cli/ops/runtime.rs')
-rw-r--r--cli/ops/runtime.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/ops/runtime.rs b/cli/ops/runtime.rs
index d059301f1..b1eddc265 100644
--- a/cli/ops/runtime.rs
+++ b/cli/ops/runtime.rs
@@ -14,7 +14,12 @@ use deno_core::OpState;
use deno_core::ZeroCopyBuf;
use std::env;
-pub fn init(rt: &mut deno_core::JsRuntime) {
+pub fn init(rt: &mut deno_core::JsRuntime, main_module: ModuleSpecifier) {
+ {
+ let op_state = rt.op_state();
+ let mut state = op_state.borrow_mut();
+ state.put::<ModuleSpecifier>(main_module);
+ }
super::reg_json_sync(rt, "op_start", op_start);
super::reg_json_sync(rt, "op_main_module", op_main_module);
super::reg_json_sync(rt, "op_metrics", op_metrics);