diff options
Diffstat (limited to 'ext/napi/lib.rs')
-rw-r--r-- | ext/napi/lib.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/ext/napi/lib.rs b/ext/napi/lib.rs index 59a07136d..628ecd5a2 100644 --- a/ext/napi/lib.rs +++ b/ext/napi/lib.rs @@ -514,7 +514,7 @@ impl Env { } } -pub fn init<P: NapiPermissions + 'static>(unstable: bool) -> Extension { +pub fn init<P: NapiPermissions + 'static>() -> Extension { Extension::builder(env!("CARGO_PKG_NAME")) .ops(vec![op_napi_open::decl::<P>()]) .event_loop_middleware(|op_state_rc, cx| { @@ -578,7 +578,6 @@ pub fn init<P: NapiPermissions + 'static>(unstable: bool) -> Extension { env_cleanup_hooks: Rc::new(RefCell::new(vec![])), tsfn_ref_counters: Arc::new(Mutex::new(vec![])), }); - state.put(Unstable(unstable)); Ok(()) }) .build() @@ -589,17 +588,6 @@ pub trait NapiPermissions { -> std::result::Result<(), AnyError>; } -pub struct Unstable(pub bool); - -fn check_unstable(state: &OpState) { - let unstable = state.borrow::<Unstable>(); - - if !unstable.0 { - eprintln!("Unstable API 'node-api'. The --unstable flag must be provided."); - std::process::exit(70); - } -} - #[op(v8)] fn op_napi_open<NP, 'scope>( scope: &mut v8::HandleScope<'scope>, @@ -610,7 +598,6 @@ fn op_napi_open<NP, 'scope>( where NP: NapiPermissions + 'static, { - check_unstable(op_state); let permissions = op_state.borrow_mut::<NP>(); permissions.check(Some(&PathBuf::from(&path)))?; |