diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-03-31 10:58:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-31 10:58:19 -0400 |
commit | eb6f6ff33d5b1e5c4ac799936cd1a80aa6213bdf (patch) | |
tree | a6306b68228a81aec43024b183678675d9ca265b /cli/standalone/mod.rs | |
parent | 05598af36edddd94b2349217da0e7c9ec65c06b1 (diff) |
refactor: cleanup main entrypoint (#23145)
Diffstat (limited to 'cli/standalone/mod.rs')
-rw-r--r-- | cli/standalone/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index dde70f63a..043f05e13 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -319,7 +319,7 @@ impl RootCertStoreProvider for StandaloneRootCertStoreProvider { pub async fn run( mut eszip: eszip::EszipV2, metadata: Metadata, -) -> Result<(), AnyError> { +) -> Result<i32, AnyError> { let main_module = &metadata.entrypoint; let current_exe_path = std::env::current_exe().unwrap(); let current_exe_name = @@ -574,12 +574,14 @@ pub async fn run( false, ); + // Initialize v8 once from the main thread. v8_set_flags(construct_v8_flags(&[], &metadata.v8_flags, vec![])); + deno_core::JsRuntime::init_platform(None); let mut worker = worker_factory .create_main_worker(main_module.clone(), permissions) .await?; let exit_code = worker.run().await?; - std::process::exit(exit_code) + Ok(exit_code) } |