summaryrefslogtreecommitdiff
path: root/cli/lib.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-04-21 09:48:44 -0400
committerGitHub <noreply@github.com>2020-04-21 09:48:44 -0400
commitcc1720132a9c875d377c559d301bccdda2fb71c1 (patch)
treebba93c08ab0eaea148e754381b5a668f1a88ca28 /cli/lib.rs
parentef6ee25e09c902e1f9d89a40cf05660432e7143c (diff)
Move resource_table from deno::State to deno_core::Isolate (#4834)
Diffstat (limited to 'cli/lib.rs')
-rw-r--r--cli/lib.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/cli/lib.rs b/cli/lib.rs
index 467c05708..178e36c99 100644
--- a/cli/lib.rs
+++ b/cli/lib.rs
@@ -140,19 +140,20 @@ fn create_main_worker(
) -> Result<MainWorker, ErrBox> {
let state = State::new(global_state, None, main_module, DebugType::Main)?;
- {
- let mut s = state.borrow_mut();
- let (stdin, stdout, stderr) = get_stdio();
- s.resource_table.add("stdin", Box::new(stdin));
- s.resource_table.add("stdout", Box::new(stdout));
- s.resource_table.add("stderr", Box::new(stderr));
- }
-
let mut worker = MainWorker::new(
"main".to_string(),
startup_data::deno_isolate_init(),
state,
);
+
+ {
+ let (stdin, stdout, stderr) = get_stdio();
+ let mut t = worker.resource_table.borrow_mut();
+ t.add("stdin", Box::new(stdin));
+ t.add("stdout", Box::new(stdout));
+ t.add("stderr", Box::new(stderr));
+ }
+
worker.execute("bootstrapMainRuntime()")?;
Ok(worker)
}