Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for node@12 #76

Merged
merged 3 commits into from
Jun 24, 2019
Merged

Add support for node@12 #76

merged 3 commits into from
Jun 24, 2019

Conversation

paopaojr
Copy link
Contributor

Fix when compiled with node@12 got the following errors

../node_modules/nan/nan_converters_43_inl.h:22:1: warning: 'ToBoolean' is deprecated: ToBoolean can never throw. Use
      Local version. [-Wdeprecated-declarations]
X(Boolean)
^
../node_modules/nan/nan_converters_43_inl.h:18:12: note: expanded from macro 'X'
      val->To ## TYPE(isolate->GetCurrentContext())                            \
           ^
<scratch space>:140:1: note: expanded from here
ToBoolean
^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:2523:3: note: 'ToBoolean' has been explicitly marked
      deprecated here
  V8_DEPRECATE_SOON("ToBoolean can never throw. Use Local version.",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
In file included from ../node_modules/nan/nan.h:221:
In file included from ../node_modules/nan/nan_converters.h:67:
../node_modules/nan/nan_converters_43_inl.h:40:1: warning: 'BooleanValue' is deprecated: BooleanValue can never throw.
      Use Isolate version. [-Wdeprecated-declarations]
X(bool, Boolean)
^
../node_modules/nan/nan_converters_43_inl.h:37:15: note: expanded from macro 'X'
  return val->NAME ## Value(isolate->GetCurrentContext());                     \
              ^
<scratch space>:147:1: note: expanded from here
BooleanValue
^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:2561:3: note: 'BooleanValue' has been explicitly marked
      deprecated here
  V8_DEPRECATED("BooleanValue can never throw. Use Isolate version.",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
In file included from ../node_modules/nan/nan.h:222:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to
      'Local<v8::Context>'
  return scope.Escape(v8::Function::New( isolate
                                         ^~~~~~~
/Users/user/.node-gyp/12.4.0/include/node/v8.h:183:7: note: candidate constructor
      (the implicit copy constructor) not viable: no known conversion from 'v8::Isolate *' to
      'const v8::Local<v8::Context> &' for 1st argument
class Local {
      ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:183:7: note: candidate constructor
      (the implicit move constructor) not viable: no known conversion from 'v8::Isolate *' to
      'v8::Local<v8::Context> &&' for 1st argument
/Users/user/.node-gyp/12.4.0/include/node/v8.h:187:13: note: candidate template ignored: could not match
      'Local<type-parameter-0-0>' against 'v8::Isolate *'
  V8_INLINE Local(Local<S> that)
            ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:4126:22: note: passing argument to parameter 'context' here
      Local<Context> context, FunctionCallback callback,
                     ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
../node_modules/nan/nan.h:1064:44: warning: 'ToString' is deprecated: Use maybe version [-Wdeprecated-declarations]
      v8::Local<v8::String> string = from->ToString(v8::Isolate::GetCurrent());
                                           ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:2543:3: note: 'ToString' has been explicitly marked
      deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
../node_modules/nan/nan.h:1855:28: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
                           ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
../node_modules/nan/nan.h:1861:28: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    New(persistentHandle)->Set(key, value);
                           ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
../node_modules/nan/nan.h:1867:28: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    New(persistentHandle)->Set(index, value);
                           ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3367:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
../node_modules/nan/nan.h:1873:32: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
        New(persistentHandle)->Get(New(key).ToLocalChecked()));
                               ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
../node_modules/nan/nan.h:1879:48: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
    return scope.Escape(New(persistentHandle)->Get(key));
                                               ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
../node_modules/nan/nan.h:1884:48: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
    return scope.Escape(New(persistentHandle)->Get(index));
                                               ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3416:3: note: 'Get' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(uint32_t index));
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
In file included from ../node_modules/nan/nan.h:2698:
../node_modules/nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object,
      v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(persistent().IsNearDeath());
           ~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note:
      expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
In file included from ../node_modules/nan/nan.h:2698:
../node_modules/nan/nan_object_wrap.h:67:18: warning: 'MarkIndependent' is deprecated: Weak objects are always
      considered independent. Use TracedGlobal when trying to use EmbedderHeapTracer. Use a strong handle when trying to
      keep an object alive. [-Wdeprecated-declarations]
    persistent().MarkIndependent();
                 ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:563:3: note: 'MarkIndependent' has been explicitly marked
      deprecated here
  V8_DEPRECATED(
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/NSFW.cpp:1:
In file included from ../src/../includes/NSFW.h:5:
In file included from ../node_modules/nan/nan.h:2698:
../node_modules/nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object,
      v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note:
      expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
../src/NSFW.cpp:51:32: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  baton->nsfw->mErrorCallback->Call(1, argv);
                               ^
../node_modules/nan/nan.h:1654:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:102:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/NSFW.cpp:75:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    jsEvent->Set(New<v8::String>("action").ToLocalChecked(), New<v8::Number>((*baton->events)[i]->type));
             ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/NSFW.cpp:76:14: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    jsEvent->Set(New<v8::String>("directory").ToLocalChecked(), New<v8::String>((*baton->events)[i]->fromDirecto...
             ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/NSFW.cpp:79:16: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
      jsEvent->Set(New<v8::String>("oldFile").ToLocalChecked(), New<v8::String>((*baton->events)[i]->fromFile).T...
               ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/NSFW.cpp:80:16: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
      jsEvent->Set(New<v8::String>("newDirectory").ToLocalChecked(), New<v8::String>((*baton->events)[i]->toDire...
               ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/NSFW.cpp:81:16: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
      jsEvent->Set(New<v8::String>("newFile").ToLocalChecked(), New<v8::String>((*baton->events)[i]->toFile).ToL...
               ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/NSFW.cpp:83:16: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
      jsEvent->Set(New<v8::String>("file").ToLocalChecked(), New<v8::String>((*baton->events)[i]->fromFile).ToLo...
               ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/NSFW.cpp:86:17: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    eventArray->Set(i, jsEvent);
                ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3367:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/NSFW.cpp:93:32: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  baton->nsfw->mEventCallback->Call(1, argv);
                               ^
../node_modules/nan/nan.h:1654:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:102:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/NSFW.cpp:149:38: error: too few arguments to function call, single argument 'context' was not specified
  constructor.Reset(tpl->GetFunction());
                    ~~~~~~~~~~~~~~~~ ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:5947:3: note: 'GetFunction' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:347:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/NSFW.cpp:150:74: error: too few arguments to function call, single argument 'context' was not specified
  Set(target, New<v8::String>("NSFW").ToLocalChecked(), tpl->GetFunction());
                                                        ~~~~~~~~~~~~~~~~ ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:5947:3: note: 'GetFunction' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:347:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/NSFW.cpp:177:46: error: too few arguments to function call, single argument 'context' was not specified
  uint32_t debounceMS = info[0]->Uint32Value();
                        ~~~~~~~~~~~~~~~~~~~~ ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:2567:3: note: 'Uint32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:347:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/NSFW.cpp:178:44: error: no matching member function for call to 'ToString'
  v8::String::Utf8Value utf8Value(info[1]->ToString());
                                  ~~~~~~~~~^~~~~~~~
/Users/user/.node-gyp/12.4.0/include/node/v8.h:2528:44: note: candidate function not viable: requires
      single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:2544:35: note: candidate function not viable: requires
      single argument 'isolate', but no arguments were provided
                    Local<String> ToString(Isolate* isolate) const);
                                  ^
../src/NSFW.cpp:209:15: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    callback->Call(1, argv);
              ^
../node_modules/nan/nan.h:1654:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:102:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/NSFW.cpp:214:33: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
  New(nsfw->mPersistentHandle)->Set(New("nsfw").ToLocalChecked(), info.This());
                                ^
/Users/user/.node-gyp/12.4.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/user/.node-gyp/12.4.0/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/NSFW.cpp:255:15: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    callback->Call(1, argv);
              ^
../node_modules/nan/nan.h:1654:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:102:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/NSFW.cpp:257:15: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    callback->Call(0, NULL);
              ^
../node_modules/nan/nan.h:1654:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:102:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/NSFW.cpp:282:15: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    callback->Call(1, argv);
              ^
../node_modules/nan/nan.h:1654:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:102:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/NSFW.cpp:324:13: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  callback->Call(0, NULL);
            ^
../node_modules/nan/nan.h:1654:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:102:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))

.travis.yml Outdated Show resolved Hide resolved
@maxhillaert
Copy link

Keen on this making it in a release for Theia to upgrade to

.travis.yml Outdated Show resolved Hide resolved
@implausible
Copy link
Contributor

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants