diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-04-15 19:08:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 20:08:33 +0200 |
commit | a080acc1b46ce9915760ce5c818763c64be8dca1 (patch) | |
tree | cbc44ea39628283b4ba73b6941bc2f9528b5b528 /cli/tools/test/mod.rs | |
parent | f36a8951a420e34d8189cda5792f5eeaa5ce85b7 (diff) |
refactor: move lifecycle events dispatch to Rust (#23358)
This commit moves logic of dispatching lifecycle events (
"load", "beforeunload", "unload") to be triggered from Rust.
Before that we were executing scripts from Rust, but now we
are storing references to functions from "99_main.js" and calling
them directly.
Prerequisite for https://github.com/denoland/deno/issues/23342
Diffstat (limited to 'cli/tools/test/mod.rs')
-rw-r--r-- | cli/tools/test/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index 2c7241de1..2a406e560 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -654,15 +654,15 @@ async fn test_specifier_inner( // Ensure that there are no pending exceptions before we start running tests worker.run_up_to_duration(Duration::from_millis(0)).await?; - worker.dispatch_load_event(located_script_name!())?; + worker.dispatch_load_event()?; run_tests_for_worker(&mut worker, &specifier, &options, &fail_fast_tracker) .await?; // Ignore `defaultPrevented` of the `beforeunload` event. We don't allow the // event loop to continue beyond what's needed to await results. - worker.dispatch_beforeunload_event(located_script_name!())?; - worker.dispatch_unload_event(located_script_name!())?; + worker.dispatch_beforeunload_event()?; + worker.dispatch_unload_event()?; // Ensure all output has been flushed _ = sender.flush(); |