Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b741f2f

Browse filesBrowse files
jasnellMylesBorins
authored andcommitted
src: move node_process to modern THROW_ERR*
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #35472 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 992355c commit b741f2f
Copy full SHA for b741f2f

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Collapse file

‎src/node_process_methods.cc‎

Copy file name to clipboardExpand all lines: src/node_process_methods.cc
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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) {
322323
static 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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.