GithubHelp home page GithubHelp logo

nodesource / upgrade-utils Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 5.0 44 KB

A tool from NodeSource to help with the process of upgrading modules to the latest version of Node.js, replacing old NAN C++ bindings and adjusting for Node.js API changes.

License: MIT License

JavaScript 55.68% CSS 34.37% HTML 9.95%

upgrade-utils's People

Contributors

edsadr avatar santigimeno avatar thefourtheye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

upgrade-utils's Issues

Some cases aren't handled properly

Firstly I want to say thanks, the app is very handy.

As far as I've noticed from the source code there are some cases that aren't handled properly (most of them I've found from my last comment to update_to_nan_v2.0.x.sh gist by @thlorenz):

-       v8::Local<v8::FunctionTemplate> tpl = NanNew<v8::FunctionTemplate>(New);
        tpl->SetClassName(NanNew<v8::String>(className));
+       v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
        tpl->SetClassName(Nan::New<v8::String>(className));

As far as I understand the code above should become:

tpl->SetClassName(Nan::New<v8::String>(className).ToLocalChecked());  // `ToLocalChecked()` results should be passed to `SetClassName()`

The same goes to this part:

-       target->Set(NanNew<v8::String>(className), tpl->GetFunction());
+       target->Set(Nan::New<v8::String>(className), tpl->GetFunction());

It should become

target->Set(Nan::New<v8::String>(className).ToLocalChecked(), tpl->GetFunction());

The code:

NanAssignPersistent<v8::Function>(constructor, tpl->GetFunction());

stays untouched and I believe it's because of this \w+ rule in NanAssignPersistent regexp.

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.