Skip to content
Closed
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
src: fix compiler warning from SetAccessor
Currently the following compiler warning is displayed when building:
../src/node.cc:3270:12: warning: 'SetAccessor' is deprecated
[-Wdeprecated-declarations]
  process->SetAccessor(FIXED_ONE_BYTE_STRING(env->isolate(), "ppid"),
           ^
../deps/v8/include/v8.h:3184:22: note: 'SetAccessor' has been
explicitly marked deprecated here
                bool SetAccessor(Local<Name> name,

This commit updates the call to use the Maybe<bool> version.
  • Loading branch information
danbev committed Nov 14, 2017
commit 9d1b178ad4541131f6f996ac2d677ef54186351e
5 changes: 3 additions & 2 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3267,8 +3267,9 @@ void SetupProcessObject(Environment* env,
READONLY_PROPERTY(process, "pid", Integer::New(env->isolate(), getpid()));
READONLY_PROPERTY(process, "features", GetFeatures(env));

process->SetAccessor(FIXED_ONE_BYTE_STRING(env->isolate(), "ppid"),
GetParentProcessId);
process->SetAccessor(env->context(),
FIXED_ONE_BYTE_STRING(env->isolate(), "ppid"),
GetParentProcessId).FromJust();

auto need_immediate_callback_string =
FIXED_ONE_BYTE_STRING(env->isolate(), "_needImmediateCallback");
Expand Down