@@ -1113,7 +1113,7 @@ void PromiseRejectCallback(PromiseRejectMessage message) {
1113
1113
Local<Value> args[] = { event, promise, value };
1114
1114
Local<Object> process = env->process_object ();
1115
1115
1116
- callback->Call (process, ARRAY_SIZE (args), args);
1116
+ callback->Call (process, arraysize (args), args);
1117
1117
}
1118
1118
1119
1119
void SetupPromises (const FunctionCallbackInfo<Value>& args) {
@@ -1196,7 +1196,7 @@ Local<Value> MakeCallback(Environment* env,
1196
1196
{ Undefined (env->isolate ()).As <Value>(), did_throw };
1197
1197
TryCatch try_catch (env->isolate ());
1198
1198
MaybeLocal<Value> ar =
1199
- post_fn->Call (env->context (), object, ARRAY_SIZE (vals), vals);
1199
+ post_fn->Call (env->context (), object, arraysize (vals), vals);
1200
1200
if (ar.IsEmpty ()) {
1201
1201
ClearFatalExceptionHandlers (env);
1202
1202
FatalException (env->isolate (), try_catch);
@@ -1651,7 +1651,7 @@ static void GetActiveRequests(const FunctionCallbackInfo<Value>& args) {
1651
1651
if (w->persistent ().IsEmpty ())
1652
1652
continue ;
1653
1653
argv[idx] = w->object ();
1654
- if (++idx >= ARRAY_SIZE (argv)) {
1654
+ if (++idx >= arraysize (argv)) {
1655
1655
fn->Call (ctx, ary, idx, argv).ToLocalChecked ();
1656
1656
idx = 0 ;
1657
1657
}
@@ -1686,7 +1686,7 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) {
1686
1686
if (owner->IsUndefined ())
1687
1687
owner = object;
1688
1688
argv[idx] = owner;
1689
- if (++idx >= ARRAY_SIZE (argv)) {
1689
+ if (++idx >= arraysize (argv)) {
1690
1690
fn->Call (ctx, ary, idx, argv).ToLocalChecked ();
1691
1691
idx = 0 ;
1692
1692
}
@@ -2520,12 +2520,12 @@ static void EnvGetter(Local<String> property,
2520
2520
WCHAR buffer[32767 ]; // The maximum size allowed for environment variables.
2521
2521
DWORD result = GetEnvironmentVariableW (reinterpret_cast <WCHAR*>(*key),
2522
2522
buffer,
2523
- ARRAY_SIZE (buffer));
2523
+ arraysize (buffer));
2524
2524
// If result >= sizeof buffer the buffer was too small. That should never
2525
2525
// happen. If result == 0 and result != ERROR_SUCCESS the variable was not
2526
2526
// not found.
2527
2527
if ((result > 0 || GetLastError () == ERROR_SUCCESS) &&
2528
- result < ARRAY_SIZE (buffer)) {
2528
+ result < arraysize (buffer)) {
2529
2529
const uint16_t * two_byte_buffer = reinterpret_cast <const uint16_t *>(buffer);
2530
2530
Local<String> rc = String::NewFromTwoByte (isolate, two_byte_buffer);
2531
2531
return info.GetReturnValue ().Set (rc);
@@ -2626,7 +2626,7 @@ static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
2626
2626
var,
2627
2627
String::kNormalString ,
2628
2628
length);
2629
- if (++idx >= ARRAY_SIZE (argv)) {
2629
+ if (++idx >= arraysize (argv)) {
2630
2630
fn->Call (ctx, envarr, idx, argv).ToLocalChecked ();
2631
2631
idx = 0 ;
2632
2632
}
@@ -2658,7 +2658,7 @@ static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
2658
2658
two_byte_buffer,
2659
2659
String::kNormalString ,
2660
2660
two_byte_buffer_len);
2661
- if (++idx >= ARRAY_SIZE (argv)) {
2661
+ if (++idx >= arraysize (argv)) {
2662
2662
fn->Call (ctx, envarr, idx, argv).ToLocalChecked ();
2663
2663
idx = 0 ;
2664
2664
}
@@ -3556,7 +3556,7 @@ static void EnableDebug(Environment* env) {
3556
3556
FIXED_ONE_BYTE_STRING (env->isolate (), " internalMessage" ),
3557
3557
message
3558
3558
};
3559
- MakeCallback (env, env->process_object (), " emit" , ARRAY_SIZE (argv), argv);
3559
+ MakeCallback (env, env->process_object (), " emit" , arraysize (argv), argv);
3560
3560
3561
3561
// Enabled debugger, possibly making it wait on a semaphore
3562
3562
env->debugger_agent ()->Enable ();
@@ -3677,7 +3677,7 @@ static int RegisterDebugSignalHandler() {
3677
3677
3678
3678
if (GetDebugSignalHandlerMappingName (pid,
3679
3679
mapping_name,
3680
- ARRAY_SIZE (mapping_name)) < 0 ) {
3680
+ arraysize (mapping_name)) < 0 ) {
3681
3681
return -1 ;
3682
3682
}
3683
3683
@@ -3740,7 +3740,7 @@ static void DebugProcess(const FunctionCallbackInfo<Value>& args) {
3740
3740
3741
3741
if (GetDebugSignalHandlerMappingName (pid,
3742
3742
mapping_name,
3743
- ARRAY_SIZE (mapping_name)) < 0 ) {
3743
+ arraysize (mapping_name)) < 0 ) {
3744
3744
env->ThrowErrnoException (errno, " sprintf" );
3745
3745
goto out;
3746
3746
}
@@ -4017,7 +4017,7 @@ void EmitBeforeExit(Environment* env) {
4017
4017
FIXED_ONE_BYTE_STRING (env->isolate (), " beforeExit" ),
4018
4018
process_object->Get (exit_code)->ToInteger (env->isolate ())
4019
4019
};
4020
- MakeCallback (env, process_object, " emit" , ARRAY_SIZE (args), args);
4020
+ MakeCallback (env, process_object, " emit" , arraysize (args), args);
4021
4021
}
4022
4022
4023
4023
@@ -4036,7 +4036,7 @@ int EmitExit(Environment* env) {
4036
4036
Integer::New (env->isolate (), code)
4037
4037
};
4038
4038
4039
- MakeCallback (env, process_object, " emit" , ARRAY_SIZE (args), args);
4039
+ MakeCallback (env, process_object, " emit" , arraysize (args), args);
4040
4040
4041
4041
// Reload exit code, it may be changed by `emit('exit')`
4042
4042
return process_object->Get (exitCode)->Int32Value ();
0 commit comments