Git Product home page Git Product logo

Comments (5)

chjj avatar chjj commented on June 16, 2024 1

This issue seems to be getting a lot of attention from people in the community. Please note that Nan::To can be used in place of the nasty v8 syntax.

For example:

Nan::To<int32_t>(info[0]).FromJust()

Instead of:

info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();

from bcrypto.

chjj avatar chjj commented on June 16, 2024

It looks like nan has upgraded for this, but only for strings: nodejs/nan@24a22c3

Corresponding PR: nodejs/nan#808

Nevermind, looks like it's still in the works: nodejs/nan#811

from bcrypto.

chjj avatar chjj commented on June 16, 2024

Finally fixed with 3a3bb28

from bcrypto.

cocoche007 avatar cocoche007 commented on June 16, 2024

Hi all,

In Node 8, I had:

v8::String::Utf8Value textV8(args[4]->ToString());
std::string           text(*textV8);

But in Node 12, with:

v8::Local<v8::String> textV8(args[4]->ToString(context).FromMaybe(v8::Local<v8::String>()));

I don't figure out how concert in std::string

Edit:
For the moment, I found this solution but too complicated for me:

v8::Local<v8::String> textV8(args[4]->ToString(context).FromMaybe(v8::Local<v8::String>()));
Nan::Utf8String       textNan(textV8);
std::string           text(*textNan);

from bcrypto.

Rainmen-xia avatar Rainmen-xia commented on June 16, 2024

marked

from bcrypto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.