fix(cli): panic when stdio is null on windows (#6528)

Fixes: #6409
This commit is contained in:
Maayan Hanin 2020-07-09 22:06:51 +03:00 committed by GitHub
parent 202e7fa6ad
commit edb7a0eead
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 289 additions and 33 deletions

View file

@ -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)