upgrade-utils icon indicating copy to clipboard operation
upgrade-utils copied to clipboard

Some cases aren't handled properly

Open narqo opened this issue 10 years ago • 3 comments

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.

narqo avatar Sep 30 '15 16:09 narqo

@narqo Thanks a lot! we are reviewing it, we'll let you know any advance

cronopio avatar Oct 02 '15 16:10 cronopio

@narqo first case is solved in the new version 1.0.3 and we have a pending discussion for the second one, will leave the issue open in the meantime and expect an update next week

Thanks for reporting

edsadr avatar Oct 02 '15 17:10 edsadr

@edsadr nice to hear that, thanks!

narqo avatar Oct 02 '15 20:10 narqo