refactor: use primordials in runtime/, part2 (#11248)

This commit is contained in:
Bartek Iwańczuk 2021-07-04 00:17:52 +02:00 committed by GitHub
parent ffa75be480
commit 5addba2abc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 257 additions and 164 deletions

View file

@ -6,6 +6,13 @@
const { File } = window.__bootstrap.files;
const { readAll } = window.__bootstrap.io;
const { assert, pathFromURL } = window.__bootstrap.util;
const {
ArrayPrototypeMap,
TypeError,
isNaN,
ObjectEntries,
String,
} = window.__bootstrap.primordials;
function opKill(pid, signo) {
core.opSync("op_kill", { pid, signo });
@ -102,9 +109,9 @@
cmd[0] = pathFromURL(cmd[0]);
}
const res = opRun({
cmd: cmd.map(String),
cmd: ArrayPrototypeMap(cmd, String),
cwd,
env: Object.entries(env),
env: ObjectEntries(env),
stdin: isRid(stdin) ? "" : stdin,
stdout: isRid(stdout) ? "" : stdout,
stderr: isRid(stderr) ? "" : stderr,