@@ -157,8 +157,9 @@ static void Kill(const FunctionCallbackInfo<Value>& args) {
157157 Environment* env = Environment::GetCurrent (args);
158158 Local<Context> context = env->context ();
159159
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+ }
162163
163164 int pid;
164165 if (!args[0 ]->Int32Value (context).To (&pid)) return ;
@@ -322,8 +323,8 @@ static void ResourceUsage(const FunctionCallbackInfo<Value>& args) {
322323static void DebugProcess (const FunctionCallbackInfo<Value>& args) {
323324 Environment* env = Environment::GetCurrent (args);
324325
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." );
327328 }
328329
329330 CHECK (args[0 ]->IsNumber ());
@@ -347,9 +348,8 @@ static void DebugProcess(const FunctionCallbackInfo<Value>& args) {
347348 Environment* env = Environment::GetCurrent (args);
348349 Isolate* isolate = args.GetIsolate ();
349350
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." );
353353 }
354354
355355 HANDLE process = nullptr ;
0 commit comments