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

ToString/ToObject deprecated? #837

Closed
brd opened this issue Jan 1, 2019 · 4 comments
Closed

ToString/ToObject deprecated? #837

brd opened this issue Jan 1, 2019 · 4 comments

Comments

@brd
Copy link

brd commented Jan 1, 2019

I am getting the following build error when using Clang 6.0.1

gmake: Entering directory '/usr/home/raspberry/node_modules/curve25519-n/build'
  CXX(target) Release/obj.target/curve/node_curve.o
In file included from ../node_curve.cc:10:
../../nan/nan.h:1064:44: warning: 'ToString' is deprecated: Use maybe version [-Wdeprecated-declarations]
      v8::Local<v8::String> string = from->ToString(v8::Isolate::GetCurrent());
                                           ^
../node_curve.cc:18:70: warning: 'ToObject' is deprecated: Use maybe version [-Wdeprecated-declarations]
  unsigned char* arg0 = (unsigned char*) node::Buffer::Data(info[0]->ToObject());
                                                                     ^
/root/.node-gyp/11.2.0/include/node/v8.h:2549:10: note: 'ToObject' has been explicitly marked deprecated here
  inline V8_DEPRECATED("Use maybe version", Local<Object> ToObject() const);
         ^
@kkoopa
Copy link
Collaborator

kkoopa commented Jan 1, 2019

You are using an outdated version of NAN.

@kkoopa kkoopa closed this as completed Jan 1, 2019
@brd
Copy link
Author

brd commented Jan 2, 2019

@kkoopa
Copy link
Collaborator

kkoopa commented Jan 2, 2019

@stiv-yakovenko
Copy link

It is kind of deprecated, now you do it like this:

   v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
   auto bufferObj = info[0]->ToObject(context).ToLocalChecked();
    size_t bufferLength = Buffer::Length(bufferObj);

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

No branches or pull requests

3 participants