From 9caad06d6f254a47f0eb8175d5092fbbd482dec9 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 22 Nov 2018 00:13:57 -0500 Subject: [PATCH] src: simplify uptime and ppid return values This commit removes extraneous wrapping of return values in Uptime() and GetParentProcessId(). PR-URL: https://github.com/nodejs/node/pull/24562 Reviewed-By: Richard Lau Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis Reviewed-By: Jon Moss --- src/node_process.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/node_process.cc b/src/node_process.cc index 017d8d0073ac83..f52e985687c661 100644 --- a/src/node_process.cc +++ b/src/node_process.cc @@ -54,7 +54,6 @@ using v8::Integer; using v8::Isolate; using v8::Local; using v8::Name; -using v8::Number; using v8::PropertyCallbackInfo; using v8::String; using v8::Uint32; @@ -259,7 +258,7 @@ void Uptime(const FunctionCallbackInfo& args) { uv_update_time(env->event_loop()); uptime = uv_now(env->event_loop()) - prog_start_time; - args.GetReturnValue().Set(Number::New(env->isolate(), uptime / 1000)); + args.GetReturnValue().Set(uptime / 1000); } @@ -790,7 +789,7 @@ void EnvEnumerator(const PropertyCallbackInfo& info) { void GetParentProcessId(Local property, const PropertyCallbackInfo& info) { - info.GetReturnValue().Set(Integer::New(info.GetIsolate(), uv_os_getppid())); + info.GetReturnValue().Set(uv_os_getppid()); } void GetActiveRequests(const FunctionCallbackInfo& args) {