diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-12-13 08:07:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-13 08:07:26 -0700 |
commit | 76a6ea57753be420398d3eba8f313a6c98eab8c3 (patch) | |
tree | 66c95d582b711aa4f4234943f5526b98c8176210 /cli/tools/bench | |
parent | 461ef6bdd80347caa12934c2c16337bc8d40d9a4 (diff) |
refactor(cli): update to new deno_core promise/call methods (#21519)
Diffstat (limited to 'cli/tools/bench')
-rw-r--r-- | cli/tools/bench/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/tools/bench/mod.rs b/cli/tools/bench/mod.rs index 57d148463..ed6f10689 100644 --- a/cli/tools/bench/mod.rs +++ b/cli/tools/bench/mod.rs @@ -31,6 +31,7 @@ use deno_core::unsync::spawn; use deno_core::unsync::spawn_blocking; use deno_core::v8; use deno_core::ModuleSpecifier; +use deno_core::PollEventLoopOptions; use deno_runtime::permissions::Permissions; use deno_runtime::permissions::PermissionsContainer; use deno_runtime::tokio_util::create_and_run_current_thread; @@ -254,7 +255,11 @@ async fn bench_specifier_inner( }))?; for (desc, function) in benchmarks { sender.send(BenchEvent::Wait(desc.id))?; - let result = worker.js_runtime.call_and_await(&function).await?; + let call = worker.js_runtime.call(&function); + let result = worker + .js_runtime + .with_event_loop_promise(call, PollEventLoopOptions::default()) + .await?; let scope = &mut worker.js_runtime.handle_scope(); let result = v8::Local::new(scope, result); let result = serde_v8::from_v8::<BenchResult>(scope, result)?; |