@@ -1113,7 +1113,7 @@ void PromiseRejectCallback(PromiseRejectMessage message) {
11131113 Local<Value> args[] = { event, promise, value };
11141114 Local<Object> process = env->process_object ();
11151115
1116- callback->Call (process, ARRAY_SIZE (args), args);
1116+ callback->Call (process, arraysize (args), args);
11171117}
11181118
11191119void SetupPromises (const FunctionCallbackInfo<Value>& args) {
@@ -1196,7 +1196,7 @@ Local<Value> MakeCallback(Environment* env,
11961196 { Undefined (env->isolate ()).As <Value>(), did_throw };
11971197 TryCatch try_catch (env->isolate ());
11981198 MaybeLocal<Value> ar =
1199- post_fn->Call (env->context (), object, ARRAY_SIZE (vals), vals);
1199+ post_fn->Call (env->context (), object, arraysize (vals), vals);
12001200 if (ar.IsEmpty ()) {
12011201 ClearFatalExceptionHandlers (env);
12021202 FatalException (env->isolate (), try_catch);
@@ -1651,7 +1651,7 @@ static void GetActiveRequests(const FunctionCallbackInfo<Value>& args) {
16511651 if (w->persistent ().IsEmpty ())
16521652 continue ;
16531653 argv[idx] = w->object ();
1654- if (++idx >= ARRAY_SIZE (argv)) {
1654+ if (++idx >= arraysize (argv)) {
16551655 fn->Call (ctx, ary, idx, argv).ToLocalChecked ();
16561656 idx = 0 ;
16571657 }
@@ -1686,7 +1686,7 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) {
16861686 if (owner->IsUndefined ())
16871687 owner = object;
16881688 argv[idx] = owner;
1689- if (++idx >= ARRAY_SIZE (argv)) {
1689+ if (++idx >= arraysize (argv)) {
16901690 fn->Call (ctx, ary, idx, argv).ToLocalChecked ();
16911691 idx = 0 ;
16921692 }
@@ -2520,12 +2520,12 @@ static void EnvGetter(Local<String> property,
25202520 WCHAR buffer[32767 ]; // The maximum size allowed for environment variables.
25212521 DWORD result = GetEnvironmentVariableW (reinterpret_cast <WCHAR*>(*key),
25222522 buffer,
2523- ARRAY_SIZE (buffer));
2523+ arraysize (buffer));
25242524 // If result >= sizeof buffer the buffer was too small. That should never
25252525 // happen. If result == 0 and result != ERROR_SUCCESS the variable was not
25262526 // not found.
25272527 if ((result > 0 || GetLastError () == ERROR_SUCCESS) &&
2528- result < ARRAY_SIZE (buffer)) {
2528+ result < arraysize (buffer)) {
25292529 const uint16_t * two_byte_buffer = reinterpret_cast <const uint16_t *>(buffer);
25302530 Local<String> rc = String::NewFromTwoByte (isolate, two_byte_buffer);
25312531 return info.GetReturnValue ().Set (rc);
@@ -2626,7 +2626,7 @@ static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
26262626 var,
26272627 String::kNormalString ,
26282628 length);
2629- if (++idx >= ARRAY_SIZE (argv)) {
2629+ if (++idx >= arraysize (argv)) {
26302630 fn->Call (ctx, envarr, idx, argv).ToLocalChecked ();
26312631 idx = 0 ;
26322632 }
@@ -2658,7 +2658,7 @@ static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
26582658 two_byte_buffer,
26592659 String::kNormalString ,
26602660 two_byte_buffer_len);
2661- if (++idx >= ARRAY_SIZE (argv)) {
2661+ if (++idx >= arraysize (argv)) {
26622662 fn->Call (ctx, envarr, idx, argv).ToLocalChecked ();
26632663 idx = 0 ;
26642664 }
@@ -3556,7 +3556,7 @@ static void EnableDebug(Environment* env) {
35563556 FIXED_ONE_BYTE_STRING (env->isolate (), " internalMessage" ),
35573557 message
35583558 };
3559- MakeCallback (env, env->process_object (), " emit" , ARRAY_SIZE (argv), argv);
3559+ MakeCallback (env, env->process_object (), " emit" , arraysize (argv), argv);
35603560
35613561 // Enabled debugger, possibly making it wait on a semaphore
35623562 env->debugger_agent ()->Enable ();
@@ -3677,7 +3677,7 @@ static int RegisterDebugSignalHandler() {
36773677
36783678 if (GetDebugSignalHandlerMappingName (pid,
36793679 mapping_name,
3680- ARRAY_SIZE (mapping_name)) < 0 ) {
3680+ arraysize (mapping_name)) < 0 ) {
36813681 return -1 ;
36823682 }
36833683
@@ -3740,7 +3740,7 @@ static void DebugProcess(const FunctionCallbackInfo<Value>& args) {
37403740
37413741 if (GetDebugSignalHandlerMappingName (pid,
37423742 mapping_name,
3743- ARRAY_SIZE (mapping_name)) < 0 ) {
3743+ arraysize (mapping_name)) < 0 ) {
37443744 env->ThrowErrnoException (errno, " sprintf" );
37453745 goto out;
37463746 }
@@ -4017,7 +4017,7 @@ void EmitBeforeExit(Environment* env) {
40174017 FIXED_ONE_BYTE_STRING (env->isolate (), " beforeExit" ),
40184018 process_object->Get (exit_code)->ToInteger (env->isolate ())
40194019 };
4020- MakeCallback (env, process_object, " emit" , ARRAY_SIZE (args), args);
4020+ MakeCallback (env, process_object, " emit" , arraysize (args), args);
40214021}
40224022
40234023
@@ -4036,7 +4036,7 @@ int EmitExit(Environment* env) {
40364036 Integer::New (env->isolate (), code)
40374037 };
40384038
4039- MakeCallback (env, process_object, " emit" , ARRAY_SIZE (args), args);
4039+ MakeCallback (env, process_object, " emit" , arraysize (args), args);
40404040
40414041 // Reload exit code, it may be changed by `emit('exit')`
40424042 return process_object->Get (exitCode)->Int32Value ();
0 commit comments