| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f88132f commit 2acb57b
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -726,8 +726,7 @@ Maybe<bool> InitializeContextRuntime(Local<Context> context) { | |||
| 726 | 726 | } | |
| 727 | 727 | } else if (per_process::cli_options->disable_proto != "") { | |
| 728 | 728 | // Validated in ProcessGlobalArgs | |
| 729 | - FatalError("InitializeContextRuntime()", | ||
| 730 | - "invalid --disable-proto mode"); | ||
| 729 | + OnFatalError("InitializeContextRuntime()", "invalid --disable-proto mode"); | ||
| 731 | 730 | } | |
| 732 | 731 | ||
| 733 | 732 | 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; | |
@@ -901,8 +901,8 @@ void Agent::ToggleAsyncHook(Isolate* isolate, Local<Function> fn) { | |||
| 901 | 901 | USE(fn->Call(context, Undefined(isolate), 0, nullptr)); | |
| 902 | 902 | if (try_catch.HasCaught() && !try_catch.HasTerminated()) { | |
| 903 | 903 | PrintCaughtException(isolate, context, try_catch); | |
| 904 | - FatalError("\nnode::inspector::Agent::ToggleAsyncHook", | ||
| 905 | - "Cannot toggle Inspector's AsyncHook, please report this."); | ||
| 904 | + OnFatalError("\nnode::inspector::Agent::ToggleAsyncHook", | ||
| 905 | + "Cannot toggle Inspector's AsyncHook, please report this."); | ||
| 906 | 906 | } | |
| 907 | 907 | } | |
| 908 | 908 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -722,7 +722,8 @@ NODE_EXTERN ArrayBufferAllocator* GetArrayBufferAllocator(IsolateData* data); | |||
| 722 | 722 | // a snapshot and have a main context that was read from that snapshot. | |
| 723 | 723 | NODE_EXTERN v8::Local<v8::Context> GetMainContext(Environment* env); | |
| 724 | 724 | ||
| 725 | - NODE_EXTERN void OnFatalError(const char* location, const char* message); | ||
| 725 | + [[noreturn]] NODE_EXTERN void OnFatalError(const char* location, | ||
| 726 | + const char* message); | ||
| 726 | 727 | NODE_EXTERN void PromiseRejectCallback(v8::PromiseRejectMessage message); | |
| 727 | 728 | NODE_EXTERN bool AllowWasmCodeGenerationCallback(v8::Local<v8::Context> context, | |
| 728 | 729 | 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 | |
|---|---|---|---|
@@ -504,13 +504,7 @@ static void ReportFatalException(Environment* env, | |||
| 504 | 504 | fflush(stderr); | |
| 505 | 505 | } | |
| 506 | 506 | ||
| 507 | - [[noreturn]] void FatalError(const char* location, const char* message) { | ||
| 508 | - OnFatalError(location, message); | ||
| 509 | - // to suppress compiler warning | ||
| 510 | - ABORT(); | ||
| 511 | - } | ||
| 512 | - | ||
| 513 | - void OnFatalError(const char* location, const char* message) { | ||
| 507 | + [[noreturn]] void OnFatalError(const char* location, const char* message) { | ||
| 514 | 508 | if (location) { | |
| 515 | 509 | FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message); | |
| 516 | 510 | } else { | |
@@ -532,7 +526,8 @@ void OnFatalError(const char* location, const char* message) { | |||
| 532 | 526 | ABORT(); | |
| 533 | 527 | } | |
| 534 | 528 | ||
| 535 | - void OOMErrorHandler(const char* location, const v8::OOMDetails& details) { | ||
| 529 | + [[noreturn]] void OOMErrorHandler(const char* location, | ||
| 530 | + const v8::OOMDetails& details) { | ||
| 536 | 531 | const char* message = | |
| 537 | 532 | details.is_heap_oom ? "Allocation failed - JavaScript heap out of memory" | |
| 538 | 533 | : "Allocation failed - process out of memory"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,9 +19,9 @@ void AppendExceptionLine(Environment* env, | |||
| 19 | 19 | v8::Local<v8::Message> message, | |
| 20 | 20 | enum ErrorHandlingMode mode); | |
| 21 | 21 | ||
| 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, const v8::OOMDetails& details); | ||
| 22 | + [[noreturn]] void OnFatalError(const char* location, const char* message); | ||
| 23 | + [[noreturn]] void OOMErrorHandler(const char* location, | ||
| 24 | + const v8::OOMDetails& details); | ||
| 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