@@ -67,9 +67,9 @@ static void GetHostname(const FunctionCallbackInfo<Value>& args) {
67
67
68
68
if (r != 0 ) {
69
69
CHECK_GE (args.Length (), 1 );
70
- env->CollectUVExceptionInfo (args[args. Length () - 1 ], r,
71
- " uv_os_gethostname" );
72
- return args. GetReturnValue (). SetUndefined () ;
70
+ USE ( env->CollectUVExceptionInfo (
71
+ args[args. Length () - 1 ], r, " uv_os_gethostname" ) );
72
+ return ;
73
73
}
74
74
75
75
Local<Value> ret;
@@ -85,8 +85,9 @@ static void GetOSInformation(const FunctionCallbackInfo<Value>& args) {
85
85
86
86
if (err != 0 ) {
87
87
CHECK_GE (args.Length (), 1 );
88
- env->CollectUVExceptionInfo (args[args.Length () - 1 ], err, " uv_os_uname" );
89
- return args.GetReturnValue ().SetUndefined ();
88
+ USE (env->CollectUVExceptionInfo (
89
+ args[args.Length () - 1 ], err, " uv_os_uname" ));
90
+ return ;
90
91
}
91
92
92
93
// [sysname, version, release, machine]
@@ -159,8 +160,8 @@ static void GetUptime(const FunctionCallbackInfo<Value>& args) {
159
160
double uptime;
160
161
int err = uv_uptime (&uptime);
161
162
if (err != 0 ) {
162
- env->CollectUVExceptionInfo (args[args.Length () - 1 ], err, " uv_uptime" );
163
- return args. GetReturnValue (). SetUndefined () ;
163
+ USE ( env->CollectUVExceptionInfo (args[args.Length () - 1 ], err, " uv_uptime" ) );
164
+ return ;
164
165
}
165
166
166
167
args.GetReturnValue ().Set (uptime);
@@ -189,14 +190,13 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
189
190
190
191
int err = uv_interface_addresses (&interfaces, &count);
191
192
192
- if (err == UV_ENOSYS)
193
- return args.GetReturnValue ().SetUndefined ();
193
+ if (err == UV_ENOSYS) return ;
194
194
195
195
if (err) {
196
196
CHECK_GE (args.Length (), 1 );
197
- env->CollectUVExceptionInfo (args[args. Length () - 1 ], errno,
198
- " uv_interface_addresses" );
199
- return args. GetReturnValue (). SetUndefined () ;
197
+ USE ( env->CollectUVExceptionInfo (
198
+ args[args. Length () - 1 ], errno, " uv_interface_addresses" ) );
199
+ return ;
200
200
}
201
201
202
202
Local<Value> no_scope_id = Integer::New (isolate, -1 );
@@ -267,8 +267,9 @@ static void GetHomeDirectory(const FunctionCallbackInfo<Value>& args) {
267
267
268
268
if (err) {
269
269
CHECK_GE (args.Length (), 1 );
270
- env->CollectUVExceptionInfo (args[args.Length () - 1 ], err, " uv_os_homedir" );
271
- return args.GetReturnValue ().SetUndefined ();
270
+ USE (env->CollectUVExceptionInfo (
271
+ args[args.Length () - 1 ], err, " uv_os_homedir" ));
272
+ return ;
272
273
}
273
274
274
275
Local<String> home;
@@ -299,9 +300,9 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) {
299
300
300
301
if (const int err = uv_os_get_passwd (&pwd)) {
301
302
CHECK_GE (args.Length (), 2 );
302
- env->CollectUVExceptionInfo (args[args. Length () - 1 ], err,
303
- " uv_os_get_passwd" );
304
- return args. GetReturnValue (). SetUndefined () ;
303
+ USE ( env->CollectUVExceptionInfo (
304
+ args[args. Length () - 1 ], err, " uv_os_get_passwd" ) );
305
+ return ;
305
306
}
306
307
307
308
auto free_passwd = OnScopeLeave ([&] { uv_os_free_passwd (&pwd); });
@@ -371,7 +372,10 @@ static void SetPriority(const FunctionCallbackInfo<Value>& args) {
371
372
372
373
if (err) {
373
374
CHECK (args[2 ]->IsObject ());
374
- env->CollectUVExceptionInfo (args[2 ], err, " uv_os_setpriority" );
375
+ if (env->CollectUVExceptionInfo (args[2 ], err, " uv_os_setpriority" )
376
+ .IsNothing ()) {
377
+ return ;
378
+ }
375
379
}
376
380
377
381
args.GetReturnValue ().Set (err);
@@ -390,7 +394,7 @@ static void GetPriority(const FunctionCallbackInfo<Value>& args) {
390
394
391
395
if (err) {
392
396
CHECK (args[1 ]->IsObject ());
393
- env->CollectUVExceptionInfo (args[1 ], err, " uv_os_getpriority" );
397
+ USE ( env->CollectUVExceptionInfo (args[1 ], err, " uv_os_getpriority" ) );
394
398
return ;
395
399
}
396
400
0 commit comments