summaryrefslogtreecommitdiff
path: root/op_crates/web/lib.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-10-10 05:41:11 -0400
committerGitHub <noreply@github.com>2020-10-10 11:41:11 +0200
commit08bb8b3d53eb2445de9b5e2845ab8acf9d353800 (patch)
treeebf00cb815ee1a10be00c74cbb332af33dd52dc2 /op_crates/web/lib.rs
parent782e6a2ed5d76bb5a154c56d7daf4607e5bdb93f (diff)
Fix 100% CPU idling problem by reverting #7672 (#7911)
* Revert "refactor: Worker is not a Future (#7895)" This reverts commit f4357f0ff9d39411f22504fcc20db6bd5dec6ddb. * Revert "refactor(core): JsRuntime is not a Future (#7855)" This reverts commit d8879feb8c832dbb38649551b1cb0730874f7be6. * Revert "fix(core): module execution with top level await (#7672)" This reverts commit c7c767782538243ded64742dca9b34d6af74d62d.
Diffstat (limited to 'op_crates/web/lib.rs')
-rw-r--r--op_crates/web/lib.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/op_crates/web/lib.rs b/op_crates/web/lib.rs
index eaf7e9f14..26e36365b 100644
--- a/op_crates/web/lib.rs
+++ b/op_crates/web/lib.rs
@@ -75,6 +75,7 @@ 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;
@@ -101,7 +102,7 @@ mod tests {
include_str!("abort_controller_test.js"),
)
.unwrap();
- if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) {
+ if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) {
unreachable!();
}
});
@@ -114,7 +115,7 @@ mod tests {
isolate
.execute("event_test.js", include_str!("event_test.js"))
.unwrap();
- if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) {
+ if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) {
unreachable!();
}
});
@@ -133,7 +134,7 @@ mod tests {
} else {
unreachable!();
}
- if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) {
+ if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) {
unreachable!();
}
});
@@ -146,7 +147,7 @@ mod tests {
isolate
.execute("event_target_test.js", include_str!("event_target_test.js"))
.unwrap();
- if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) {
+ if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) {
unreachable!();
}
});
@@ -162,7 +163,7 @@ mod tests {
include_str!("text_encoding_test.js"),
)
.unwrap();
- if let Poll::Ready(Err(_)) = isolate.poll_event_loop(&mut cx) {
+ if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) {
unreachable!();
}
});