From 6fa8a12448ffb84c0b6f8f2e1d1a7e3e6847bde4 Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Tue, 7 Jan 2025 15:13:21 +0100 Subject: [PATCH] process: linted code --- src/node_errors.h | 2 +- src/node_process_methods.cc | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/node_errors.h b/src/node_errors.h index 02348b2c0b58eb..33be0e6fd51450 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -15,7 +15,7 @@ namespace node { // This forward declaration is to have the method available in error messages. namespace errors { - const char* errno_string(int errorno); +const char* errno_string(int errorno); } enum ErrorHandlingMode { CONTEXTIFY_ERROR, FATAL_ERROR, MODULE_ERROR }; diff --git a/src/node_process_methods.cc b/src/node_process_methods.cc index 8f0ddb00b286d0..dafcf95f0e16c9 100644 --- a/src/node_process_methods.cc +++ b/src/node_process_methods.cc @@ -473,8 +473,9 @@ static void ReallyExit(const FunctionCallbackInfo& args) { env->Exit(code); } -inline char** copy_js_strings_array( - Environment* env, Local js_array, int* target_length) { +inline char** copy_js_strings_array(Environment* env, + Local js_array, + int* target_length) { Local context = env->context(); char** target = nullptr; int length = js_array->Length(); @@ -486,8 +487,8 @@ inline char** copy_js_strings_array( if (length > 0) { for (int i = 0; i < length; i++) { - node::Utf8Value str( - env->isolate(), js_array->Get(context, i).ToLocalChecked()); + node::Utf8Value str(env->isolate(), + js_array->Get(context, i).ToLocalChecked()); target[i] = strdup(*str); CHECK_NOT_NULL(target[i]); } @@ -529,12 +530,13 @@ static void Replace(const FunctionCallbackInfo& args) { Local argv_array = args[1].As(); - Local full_argv_array = Array::New( - env->isolate(), argv_array->Length() + 1); + Local full_argv_array = + Array::New(env->isolate(), argv_array->Length() + 1); full_argv_array->Set(context, 0, args[0].As()).Check(); for (unsigned int i = 0; i < argv_array->Length(); i++) { - full_argv_array->Set( - context, i + 1, argv_array->Get(context, i).ToLocalChecked()).Check(); + full_argv_array + ->Set(context, i + 1, argv_array->Get(context, i).ToLocalChecked()) + .Check(); } argv = copy_js_strings_array(env, full_argv_array, nullptr); @@ -561,7 +563,7 @@ static void Replace(const FunctionCallbackInfo& args) { // Set stdin, stdout and stderr to be non-close-on-exec // so that the new process will inherit it. - for (int i = 0; i < 3; i ++) { + for (int i = 0; i < 3; i++) { // Operation failed. Free up memory, then throw. if (persist_standard_stream(i) < 0) { int error_code = errno;