Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/node_process_methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static void Kill(const FunctionCallbackInfo<Value>& args) {
Local<Context> context = env->context();

if (args.Length() < 2) {
THROW_ERR_MISSING_ARGS(env, "Bad argument.");
return THROW_ERR_MISSING_ARGS(env, "Bad argument.");
}

int pid;
Expand Down
8 changes: 8 additions & 0 deletions test/parallel/test-process-kill-pid.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
const common = require('../common');
const assert = require('assert');

for (const args of [[], [process.pid]]) {
assert.throws(() => process._kill(...args), {
code: 'ERR_MISSING_ARGS',
name: 'TypeError',
message: 'Bad argument.'
});
}

// Test variants of pid
//
// null: TypeError
Expand Down
Loading