mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 02:22:40 +00:00
feat: Add requesting API name to permission prompt (#15936)
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
This commit is contained in:
parent
a344368603
commit
212b7dd6da
18 changed files with 530 additions and 235 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
const promiseIdSymbol = SymbolFor("Deno.core.internalPromiseId");
|
||||
|
||||
function spawnChild(command, {
|
||||
function spawnChildInner(command, apiName, {
|
||||
args = [],
|
||||
cwd = undefined,
|
||||
clearEnv = false,
|
||||
|
@ -44,13 +44,17 @@
|
|||
stdin,
|
||||
stdout,
|
||||
stderr,
|
||||
});
|
||||
}, apiName);
|
||||
return new Child(illegalConstructorKey, {
|
||||
...child,
|
||||
signal,
|
||||
});
|
||||
}
|
||||
|
||||
function spawnChild(command, options = {}) {
|
||||
return spawnChildInner(command, "Deno.spawnChild()", options);
|
||||
}
|
||||
|
||||
async function collectOutput(readableStream) {
|
||||
if (!(readableStream instanceof ReadableStream)) {
|
||||
return null;
|
||||
|
@ -204,7 +208,7 @@
|
|||
if (this.#rid === null) {
|
||||
throw new TypeError("Child process has already terminated.");
|
||||
}
|
||||
ops.op_kill(this.#pid, signo);
|
||||
ops.op_kill(this.#pid, signo, "Deno.Child.kill()");
|
||||
}
|
||||
|
||||
ref() {
|
||||
|
@ -228,7 +232,7 @@
|
|||
"Piped stdin is not supported for this function, use 'Deno.spawnChild()' instead",
|
||||
);
|
||||
}
|
||||
return spawnChild(command, options).output();
|
||||
return spawnChildInner(command, "Deno.spawn()", options).output();
|
||||
}
|
||||
|
||||
function spawnSync(command, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue