|
3 | 3 |
|
4 | 4 | #include "env-inl.h" |
5 | 5 | #include "node_binding.h" |
| 6 | +#include "node_errors.h" |
6 | 7 | #include "node_external_reference.h" |
7 | 8 | #include "node_internals.h" |
8 | 9 | #include "node_sea.h" |
@@ -1344,8 +1345,8 @@ void GetCLIOptionsValues(const FunctionCallbackInfo<Value>& args) { |
1344 | 1345 |
|
1345 | 1346 | if (!env->has_run_bootstrapping_code()) { |
1346 | 1347 | // No code because this is an assertion. |
1347 | | - return env->ThrowError( |
1348 | | - "Should not query options before bootstrapping is done"); |
| 1348 | + THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING( |
| 1349 | + isolate, "Should not query options before bootstrapping is done"); |
1349 | 1350 | } |
1350 | 1351 | env->set_has_serialized_options(true); |
1351 | 1352 |
|
@@ -1466,8 +1467,8 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo<Value>& args) { |
1466 | 1467 |
|
1467 | 1468 | if (!env->has_run_bootstrapping_code()) { |
1468 | 1469 | // No code because this is an assertion. |
1469 | | - return env->ThrowError( |
1470 | | - "Should not query options before bootstrapping is done"); |
| 1470 | + THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING( |
| 1471 | + isolate, "Should not query options before bootstrapping is done"); |
1471 | 1472 | } |
1472 | 1473 |
|
1473 | 1474 | Mutex::ScopedLock lock(per_process::cli_options_mutex); |
@@ -1535,7 +1536,8 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) { |
1535 | 1536 | Environment* env = Environment::GetCurrent(args); |
1536 | 1537 | if (!env->has_run_bootstrapping_code()) { |
1537 | 1538 | // No code because this is an assertion. |
1538 | | - return env->ThrowError( |
| 1539 | + THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING( |
| 1540 | + env->isolate(), |
1539 | 1541 | "Should not query options before bootstrapping is done"); |
1540 | 1542 | } |
1541 | 1543 | Isolate* isolate = args.GetIsolate(); |
@@ -1571,8 +1573,8 @@ void GetEnvOptionsInputType(const FunctionCallbackInfo<Value>& args) { |
1571 | 1573 |
|
1572 | 1574 | if (!env->has_run_bootstrapping_code()) { |
1573 | 1575 | // No code because this is an assertion. |
1574 | | - return env->ThrowError( |
1575 | | - "Should not query options before bootstrapping is done"); |
| 1576 | + THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING( |
| 1577 | + isolate, "Should not query options before bootstrapping is done"); |
1576 | 1578 | } |
1577 | 1579 |
|
1578 | 1580 | Mutex::ScopedLock lock(per_process::cli_options_mutex); |
|
0 commit comments