Skip to content

Commit

Permalink
Replace futures-lite with pollster
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Jan 20, 2023
1 parent 824bd3b commit d7e4b4e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
8 changes: 7 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions boa_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,7 @@ rust-version.workspace = true
[features]
profiler = ["boa_profiler/profiler"]
deser = ["boa_interner/serde", "boa_ast/serde"]
intl = [
"dep:boa_icu_provider",
"dep:icu_locid_transform",
"dep:icu_locid",
"dep:icu_datetime",
"dep:icu_plurals",
"dep:icu_provider",
"dep:icu_calendar",
"dep:icu_collator",
"dep:icu_list",
"dep:writeable",
"dep:sys-locale",
]
intl = ["dep:boa_icu_provider", "dep:icu_locid_transform", "dep:icu_locid", "dep:icu_datetime", "dep:icu_plurals", "dep:icu_provider", "dep:icu_calendar", "dep:icu_collator", "dep:icu_list", "dep:writeable", "dep:sys-locale"]

fuzz = ["boa_ast/fuzz", "boa_interner/fuzz"]

Expand Down Expand Up @@ -64,7 +52,7 @@ static_assertions = "1.1.0"
thiserror = "1.0.38"
dashmap = "5.4.0"
num_enum = "0.5.7"
futures-lite = { version = "1.12.0" }
pollster = "0.2.5"

# intl deps
boa_icu_provider = { workspace = true, optional = true }
Expand Down
4 changes: 2 additions & 2 deletions boa_engine/src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl NativeJob {
}
}

/// [`JobCallback`][spec] records
/// [`JobCallback`][spec] records.
///
/// [spec]: https://tc39.es/ecma262/#sec-jobcallback-records
#[derive(Trace, Finalize)]
Expand Down Expand Up @@ -232,7 +232,7 @@ impl JobQueue for SimpleJobQueue {
}

fn enqueue_future_job(&self, future: FutureJob, context: &mut Context<'_>) {
let job = futures_lite::future::block_on(future);
let job = pollster::block_on(future);
self.enqueue_promise_job(job, context);
}
}
3 changes: 1 addition & 2 deletions boa_engine/src/native_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use std::future::Future;

use boa_gc::{custom_trace, Finalize, Gc, Trace};
use futures_lite::FutureExt;

use crate::{
builtins::Promise,
Expand Down Expand Up @@ -195,7 +194,7 @@ impl NativeFunction {
};
context
.job_queue()
.enqueue_future_job(future.boxed_local(), context);
.enqueue_future_job(Box::pin(future), context);
Ok(promise.into())
})
}
Expand Down

0 comments on commit d7e4b4e

Please sign in to comment.