From 0f6a5c5fc24e8dc9125c5c536c8547a86ca87b15 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Tue, 28 Jun 2022 10:49:30 -0400 Subject: feat(web): add beforeunload event (#14830) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds the 'beforeunload' event. Co-authored-by: Bartek IwaƄczuk --- cli/lsp/testing/execution.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli/lsp/testing/execution.rs') diff --git a/cli/lsp/testing/execution.rs b/cli/lsp/testing/execution.rs index 6b4e947a0..83f74e5ed 100644 --- a/cli/lsp/testing/execution.rs +++ b/cli/lsp/testing/execution.rs @@ -226,6 +226,12 @@ async fn test_specifier( worker.js_runtime.resolve_value(test_result).await?; + loop { + if !worker.dispatch_beforeunload_event(&located_script_name!())? { + break; + } + worker.run_event_loop(false).await?; + } worker.dispatch_unload_event(&located_script_name!())?; } -- cgit v1.2.3