@@ -164,8 +164,9 @@ static void Kill(const FunctionCallbackInfo<Value>& args) {
164
164
Environment* env = Environment::GetCurrent (args);
165
165
Local<Context> context = env->context ();
166
166
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
+ }
169
170
170
171
int pid;
171
172
if (!args[0 ]->Int32Value (context).To (&pid)) return ;
@@ -319,8 +320,8 @@ static void ResourceUsage(const FunctionCallbackInfo<Value>& args) {
319
320
static void DebugProcess (const FunctionCallbackInfo<Value>& args) {
320
321
Environment* env = Environment::GetCurrent (args);
321
322
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." );
324
325
}
325
326
326
327
CHECK (args[0 ]->IsNumber ());
@@ -344,9 +345,8 @@ static void DebugProcess(const FunctionCallbackInfo<Value>& args) {
344
345
Environment* env = Environment::GetCurrent (args);
345
346
Isolate* isolate = args.GetIsolate ();
346
347
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." );
350
350
}
351
351
352
352
HANDLE process = nullptr ;
0 commit comments