| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d3449ca commit 8e6af9f
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -661,8 +661,7 @@ Maybe<bool> InitializeContextRuntime(Local<Context> context) { | |||
| 661 | 661 | } | |
| 662 | 662 | } else if (per_process::cli_options->disable_proto != "") { | |
| 663 | 663 | // Validated in ProcessGlobalArgs | |
| 664 | - FatalError("InitializeContextRuntime()", | ||
| 665 | - "invalid --disable-proto mode"); | ||
| 664 | + OnFatalError("InitializeContextRuntime()", "invalid --disable-proto mode"); | ||
| 666 | 665 | } | |
| 667 | 666 | ||
| 668 | 667 | return Just(true); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ namespace node { | |||
| 36 | 36 | namespace inspector { | |
| 37 | 37 | namespace { | |
| 38 | 38 | ||
| 39 | - using node::FatalError; | ||
| 39 | + using node::OnFatalError; | ||
| 40 | 40 | ||
| 41 | 41 | using v8::Context; | |
| 42 | 42 | using v8::Function; | |
@@ -898,8 +898,8 @@ void Agent::ToggleAsyncHook(Isolate* isolate, Local<Function> fn) { | |||
| 898 | 898 | USE(fn->Call(context, Undefined(isolate), 0, nullptr)); | |
| 899 | 899 | if (try_catch.HasCaught() && !try_catch.HasTerminated()) { | |
| 900 | 900 | PrintCaughtException(isolate, context, try_catch); | |
| 901 | - FatalError("\nnode::inspector::Agent::ToggleAsyncHook", | ||
| 902 | - "Cannot toggle Inspector's AsyncHook, please report this."); | ||
| 901 | + OnFatalError("\nnode::inspector::Agent::ToggleAsyncHook", | ||
| 902 | + "Cannot toggle Inspector's AsyncHook, please report this."); | ||
| 903 | 903 | } | |
| 904 | 904 | } | |
| 905 | 905 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -645,7 +645,8 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context); | |||
| 645 | 645 | NODE_EXTERN IsolateData* GetEnvironmentIsolateData(Environment* env); | |
| 646 | 646 | NODE_EXTERN ArrayBufferAllocator* GetArrayBufferAllocator(IsolateData* data); | |
| 647 | 647 | ||
| 648 | - NODE_EXTERN void OnFatalError(const char* location, const char* message); | ||
| 648 | + [[noreturn]] NODE_EXTERN void OnFatalError(const char* location, | ||
| 649 | + const char* message); | ||
| 649 | 650 | NODE_EXTERN void PromiseRejectCallback(v8::PromiseRejectMessage message); | |
| 650 | 651 | NODE_EXTERN bool AllowWasmCodeGenerationCallback(v8::Local<v8::Context> context, | |
| 651 | 652 | v8::Local<v8::String>); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -805,7 +805,7 @@ NAPI_NO_RETURN void NAPI_CDECL napi_fatal_error(const char* location, | |||
| 805 | 805 | message_string.assign(const_cast<char*>(message), strlen(message)); | |
| 806 | 806 | } | |
| 807 | 807 | ||
| 808 | - node::FatalError(location_string.c_str(), message_string.c_str()); | ||
| 808 | + node::OnFatalError(location_string.c_str(), message_string.c_str()); | ||
| 809 | 809 | } | |
| 810 | 810 | ||
| 811 | 811 | napi_status NAPI_CDECL | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -499,13 +499,7 @@ static void ReportFatalException(Environment* env, | |||
| 499 | 499 | fflush(stderr); | |
| 500 | 500 | } | |
| 501 | 501 | ||
| 502 | - [[noreturn]] void FatalError(const char* location, const char* message) { | ||
| 503 | - OnFatalError(location, message); | ||
| 504 | - // to suppress compiler warning | ||
| 505 | - ABORT(); | ||
| 506 | - } | ||
| 507 | - | ||
| 508 | - void OnFatalError(const char* location, const char* message) { | ||
| 502 | + [[noreturn]] void OnFatalError(const char* location, const char* message) { | ||
| 509 | 503 | if (location) { | |
| 510 | 504 | FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message); | |
| 511 | 505 | } else { | |
@@ -527,7 +521,7 @@ void OnFatalError(const char* location, const char* message) { | |||
| 527 | 521 | ABORT(); | |
| 528 | 522 | } | |
| 529 | 523 | ||
| 530 | - void OOMErrorHandler(const char* location, bool is_heap_oom) { | ||
| 524 | + [[noreturn]] void OOMErrorHandler(const char* location, bool is_heap_oom) { | ||
| 531 | 525 | const char* message = | |
| 532 | 526 | is_heap_oom ? "Allocation failed - JavaScript heap out of memory" | |
| 533 | 527 | : "Allocation failed - process out of memory"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,8 +20,8 @@ void AppendExceptionLine(Environment* env, | |||
| 20 | 20 | enum ErrorHandlingMode mode); | |
| 21 | 21 | ||
| 22 | 22 | [[noreturn]] void FatalError(const char* location, const char* message); | |
| 23 | - void OnFatalError(const char* location, const char* message); | ||
| 24 | - void OOMErrorHandler(const char* location, bool is_heap_oom); | ||
| 23 | + [[noreturn]] void OnFatalError(const char* location, const char* message); | ||
| 24 | + [[noreturn]] void OOMErrorHandler(const char* location, bool is_heap_oom); | ||
| 25 | 25 | ||
| 26 | 26 | // Helpers to construct errors similar to the ones provided by | |
| 27 | 27 | // lib/internal/errors.js. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,8 +45,7 @@ Watchdog::Watchdog(v8::Isolate* isolate, uint64_t ms, bool* timed_out) | |||
| 45 | 45 | int rc; | |
| 46 | 46 | rc = uv_loop_init(&loop_); | |
| 47 | 47 | if (rc != 0) { | |
| 48 | - FatalError("node::Watchdog::Watchdog()", | ||
| 49 | - "Failed to initialize uv loop."); | ||
| 48 | + OnFatalError("node::Watchdog::Watchdog()", "Failed to initialize uv loop."); | ||
| 50 | 49 | } | |
| 51 | 50 | ||
| 52 | 51 | rc = uv_async_init(&loop_, &async_, [](uv_async_t* signal) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments