summaryrefslogtreecommitdiff
path: root/cli/ops/mod.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-11-10 22:03:28 +0100
committerGitHub <noreply@github.com>2022-11-10 22:03:28 +0100
commit8d5c0112fbbed188f97218ace2357feba3a8746f (patch)
treecf08da990c8bf90da116e8db3ac6332cd37578a1 /cli/ops/mod.rs
parent53e974b276b095faf52918c4c6e988e9d2788cef (diff)
feat: don't require --unstable flag for npm programs (#16520)
This PR adds copies of several unstable APIs that are available in "Deno[Deno.internal].nodeUnstable" namespace. These copies do not perform unstable check (ie. don't require "--unstable" flag to be present). Otherwise they work exactly the same, including permission checks. These APIs are not meant to be used by users directly and can change at any time. Copies of following APIs are available in that namespace: - Deno.spawnChild - Deno.spawn - Deno.spawnSync - Deno.serve - Deno.upgradeHttpRaw - Deno.listenDatagram
Diffstat (limited to 'cli/ops/mod.rs')
-rw-r--r--cli/ops/mod.rs6
1 files changed, 0 insertions, 6 deletions
diff --git a/cli/ops/mod.rs b/cli/ops/mod.rs
index df3331353..c02b951b2 100644
--- a/cli/ops/mod.rs
+++ b/cli/ops/mod.rs
@@ -1,7 +1,6 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
use crate::proc_state::ProcState;
-use deno_core::anyhow::bail;
use deno_core::error::AnyError;
use deno_core::op;
use deno_core::Extension;
@@ -27,10 +26,5 @@ fn init_proc_state(ps: ProcState) -> Extension {
#[op]
fn op_npm_process_state(state: &mut OpState) -> Result<String, AnyError> {
let proc_state = state.borrow_mut::<ProcState>();
- if !proc_state.options.unstable() {
- bail!(
- "Unstable use of npm process state. The --unstable flag must be provided."
- )
- }
Ok(proc_state.npm_resolver.get_npm_process_state())
}