diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-10-07 22:30:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-07 22:30:06 +0200 |
commit | d8879feb8c832dbb38649551b1cb0730874f7be6 (patch) | |
tree | ece7adc6d3611c87f6c2f13732b29ac4314a80ef /op_crates | |
parent | 8bd7c936f9a9a63334e5f512d6b6c1f8b47a42b8 (diff) |
refactor(core): JsRuntime is not a Future (#7855)
This commit rewrites deno_core::JsRuntime to not implement Future
trait.
Instead there are two separate methods:
- JsRuntime::poll_event_loop() - does single tick of event loop
- JsRuntime::run_event_loop() - runs event loop to completion
Diffstat (limited to 'op_crates')
-rw-r--r-- | op_crates/web/lib.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/op_crates/web/lib.rs b/op_crates/web/lib.rs index 26e36365b..eaf7e9f14 100644 --- a/op_crates/web/lib.rs +++ b/op_crates/web/lib.rs @@ -75,7 +75,6 @@ pub fn get_declaration() -> PathBuf { mod tests { use deno_core::JsRuntime; use futures::future::lazy; - use futures::future::FutureExt; use futures::task::Context; use futures::task::Poll; @@ -102,7 +101,7 @@ mod tests { include_str!("abort_controller_test.js"), ) .unwrap(); - if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { unreachable!(); } }); @@ -115,7 +114,7 @@ mod tests { isolate .execute("event_test.js", include_str!("event_test.js")) .unwrap(); - if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { unreachable!(); } }); @@ -134,7 +133,7 @@ mod tests { } else { unreachable!(); } - if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { unreachable!(); } }); @@ -147,7 +146,7 @@ mod tests { isolate .execute("event_target_test.js", include_str!("event_target_test.js")) .unwrap(); - if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { unreachable!(); } }); @@ -163,7 +162,7 @@ mod tests { include_str!("text_encoding_test.js"), ) .unwrap(); - if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { + if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) { unreachable!(); } }); |