summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/worker.rs')
-rw-r--r--cli/worker.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/cli/worker.rs b/cli/worker.rs
index 4ac1ee6a6..08367da91 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -300,9 +300,15 @@ impl MainWorker {
let state_rc = CoreIsolate::state(&worker.isolate);
let state = state_rc.borrow();
let mut t = state.resource_table.borrow_mut();
- t.add("stdin", Box::new(stdin));
- t.add("stdout", Box::new(stdout));
- t.add("stderr", Box::new(stderr));
+ if let Some(stream) = stdin {
+ t.add("stdin", Box::new(stream));
+ }
+ if let Some(stream) = stdout {
+ t.add("stdout", Box::new(stream));
+ }
+ if let Some(stream) = stderr {
+ t.add("stderr", Box::new(stream));
+ }
}
worker.execute("bootstrap.mainRuntime()")?;
Ok(worker)