From 21dfeea3c48cf6101d71b39a1d2b0f9406818300 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 13 Jun 2022 15:28:00 -0400 Subject: Remove unstable Deno.sleepSync (#14719) Co-authored-by: David Sherret --- ext/web/02_timers.js | 5 ----- ext/web/lib.rs | 2 -- ext/web/timers.rs | 9 --------- 3 files changed, 16 deletions(-) (limited to 'ext/web') diff --git a/ext/web/02_timers.js b/ext/web/02_timers.js index edad89ace..a4ce33a18 100644 --- a/ext/web/02_timers.js +++ b/ext/web/02_timers.js @@ -28,10 +28,6 @@ return core.opSync("op_now"); } - function sleepSync(millis = 0) { - return core.opSync("op_sleep_sync", millis); - } - // --------------------------------------------------------------------------- /** @@ -372,7 +368,6 @@ clearInterval, handleTimerMacrotask, opNow, - sleepSync, refTimer, unrefTimer, }; diff --git a/ext/web/lib.rs b/ext/web/lib.rs index ae5cf2d80..b21ea3812 100644 --- a/ext/web/lib.rs +++ b/ext/web/lib.rs @@ -52,7 +52,6 @@ pub use crate::message_port::MessagePort; use crate::timers::op_now; use crate::timers::op_sleep; -use crate::timers::op_sleep_sync; use crate::timers::op_timer_handle; use crate::timers::StartTime; pub use crate::timers::TimersPermission; @@ -111,7 +110,6 @@ pub fn init( op_timer_handle::decl(), op_cancel_handle::decl(), op_sleep::decl(), - op_sleep_sync::decl::

(), ]) .state(move |state| { state.put(blob_store.clone()); diff --git a/ext/web/timers.rs b/ext/web/timers.rs index eee770719..f57baa559 100644 --- a/ext/web/timers.rs +++ b/ext/web/timers.rs @@ -82,12 +82,3 @@ pub async fn op_sleep( .await?; Ok(()) } - -#[op] -pub fn op_sleep_sync(state: &mut OpState, millis: u64) -where - TP: TimersPermission + 'static, -{ - state.borrow::().check_unstable(state, "Deno.sleepSync"); - std::thread::sleep(Duration::from_millis(millis)); -} -- cgit v1.2.3