summaryrefslogtreecommitdiff
path: root/cli/standalone.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-12-21 15:49:27 +0100
committerGitHub <noreply@github.com>2021-12-21 15:49:27 +0100
commit907cef563ec83fb5e8b95aeddbb54b5ebbf38746 (patch)
tree7695484aa68ee73071229122fa4219321e29a0c1 /cli/standalone.rs
parent9825c876b466cf69a8ddd1646ba7fedecd54ba51 (diff)
refactor: cleanup cli/main.rs (#13160)
Diffstat (limited to 'cli/standalone.rs')
-rw-r--r--cli/standalone.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/cli/standalone.rs b/cli/standalone.rs
index d7fbb3106..c7a5b2c14 100644
--- a/cli/standalone.rs
+++ b/cli/standalone.rs
@@ -284,15 +284,9 @@ pub async fn run(
js_runtime.sync_ops_cache();
}
worker.execute_main_module(&main_module).await?;
- worker.execute_script(
- &located_script_name!(),
- "window.dispatchEvent(new Event('load'))",
- )?;
+ worker.dispatch_load_event(&located_script_name!())?;
worker.run_event_loop(true).await?;
- worker.execute_script(
- &located_script_name!(),
- "window.dispatchEvent(new Event('unload'))",
- )?;
+ worker.dispatch_unload_event(&located_script_name!())?;
std::process::exit(0);
}