@@ -157,8 +157,9 @@ static void Kill(const FunctionCallbackInfo<Value>& args) {
157
157
Environment* env = Environment::GetCurrent (args);
158
158
Local<Context> context = env->context ();
159
159
160
- if (args.Length () != 2 )
161
- return env->ThrowError (" Bad argument." );
160
+ if (args.Length () < 2 ) {
161
+ THROW_ERR_MISSING_ARGS (env, " Bad argument." );
162
+ }
162
163
163
164
int pid;
164
165
if (!args[0 ]->Int32Value (context).To (&pid)) return ;
@@ -322,8 +323,8 @@ static void ResourceUsage(const FunctionCallbackInfo<Value>& args) {
322
323
static void DebugProcess (const FunctionCallbackInfo<Value>& args) {
323
324
Environment* env = Environment::GetCurrent (args);
324
325
325
- if (args.Length () != 1 ) {
326
- return env-> ThrowError ( " Invalid number of arguments." );
326
+ if (args.Length () < 1 ) {
327
+ return THROW_ERR_MISSING_ARGS (env, " Invalid number of arguments." );
327
328
}
328
329
329
330
CHECK (args[0 ]->IsNumber ());
@@ -347,9 +348,8 @@ static void DebugProcess(const FunctionCallbackInfo<Value>& args) {
347
348
Environment* env = Environment::GetCurrent (args);
348
349
Isolate* isolate = args.GetIsolate ();
349
350
350
- if (args.Length () != 1 ) {
351
- env->ThrowError (" Invalid number of arguments." );
352
- return ;
351
+ if (args.Length () < 1 ) {
352
+ return THROW_ERR_MISSING_ARGS (env, " Invalid number of arguments." );
353
353
}
354
354
355
355
HANDLE process = nullptr ;
0 commit comments