File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 5
5
ERR_INVALID_ASYNC_ID
6
6
} = require ( 'internal/errors' ) . codes ;
7
7
8
- const { getOptionValue } = require ( 'internal/options' ) ;
9
- const shouldAbortOnUncaughtException =
10
- getOptionValue ( '--abort-on-uncaught-exception' ) ;
11
-
12
8
const async_wrap = internalBinding ( 'async_wrap' ) ;
13
9
/* async_hook_fields is a Uint32Array wrapping the uint32_t array of
14
10
* Environment::AsyncHooks::fields_[]. Each index tracks the number of active
@@ -112,7 +108,9 @@ function fatalError(e) {
112
108
Error . captureStackTrace ( o , fatalError ) ;
113
109
process . _rawDebug ( o . stack ) ;
114
110
}
115
- if ( shouldAbortOnUncaughtException ) {
111
+
112
+ const { getOptionValue } = require ( 'internal/options' ) ;
113
+ if ( getOptionValue ( '--abort-on-uncaught-exception' ) ) {
116
114
process . abort ( ) ;
117
115
}
118
116
process . exit ( 1 ) ;
Original file line number Diff line number Diff line change @@ -564,6 +564,12 @@ HostPort SplitHostPort(const std::string& arg,
564
564
void GetOptions (const FunctionCallbackInfo<Value>& args) {
565
565
Mutex::ScopedLock lock (per_process::cli_options_mutex);
566
566
Environment* env = Environment::GetCurrent (args);
567
+ if (!env->has_run_bootstrapping_code ()) {
568
+ // No code because this is an assertion.
569
+ return env->ThrowError (
570
+ " Should not query options before bootstrapping is done" );
571
+ }
572
+
567
573
Isolate* isolate = env->isolate ();
568
574
Local<Context> context = env->context ();
569
575
You can’t perform that action at this time.
0 commit comments