@@ -164,8 +164,9 @@ static void Kill(const FunctionCallbackInfo<Value>& args) {
164164 Environment* env = Environment::GetCurrent (args);
165165 Local<Context> context = env->context ();
166166
167- if (args.Length () != 2 )
168- return env->ThrowError (" Bad argument." );
167+ if (args.Length () < 2 ) {
168+ THROW_ERR_MISSING_ARGS (env, " Bad argument." );
169+ }
169170
170171 int pid;
171172 if (!args[0 ]->Int32Value (context).To (&pid)) return ;
@@ -319,8 +320,8 @@ static void ResourceUsage(const FunctionCallbackInfo<Value>& args) {
319320static void DebugProcess (const FunctionCallbackInfo<Value>& args) {
320321 Environment* env = Environment::GetCurrent (args);
321322
322- if (args.Length () != 1 ) {
323- return env-> ThrowError ( " Invalid number of arguments." );
323+ if (args.Length () < 1 ) {
324+ return THROW_ERR_MISSING_ARGS (env, " Invalid number of arguments." );
324325 }
325326
326327 CHECK (args[0 ]->IsNumber ());
@@ -344,9 +345,8 @@ static void DebugProcess(const FunctionCallbackInfo<Value>& args) {
344345 Environment* env = Environment::GetCurrent (args);
345346 Isolate* isolate = args.GetIsolate ();
346347
347- if (args.Length () != 1 ) {
348- env->ThrowError (" Invalid number of arguments." );
349- return ;
348+ if (args.Length () < 1 ) {
349+ return THROW_ERR_MISSING_ARGS (env, " Invalid number of arguments." );
350350 }
351351
352352 HANDLE process = nullptr ;
0 commit comments