diff options
Diffstat (limited to 'runtime/lib.rs')
-rw-r--r-- | runtime/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/lib.rs b/runtime/lib.rs index fb6159dd9..ca250ce20 100644 --- a/runtime/lib.rs +++ b/runtime/lib.rs @@ -1,5 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +use std::sync::atomic::AtomicI32; + pub use deno_broadcast_channel; pub use deno_console; pub use deno_crypto; @@ -29,3 +31,12 @@ pub mod worker; mod worker_bootstrap; pub use worker_bootstrap::BootstrapOptions; + +// The global may not be very elegant but: +// +// 1. op_exit() calls std::process::exit() so there is not much point storing +// the exit code in runtime state +// +// 2. storing it in runtime state makes retrieving it again in cli/main.rs +// unduly complicated +pub static EXIT_CODE: AtomicI32 = AtomicI32::new(0); |