-
Notifications
You must be signed in to change notification settings - Fork 507
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
deprecation warnings when used with node v6.0.0 #558
Comments
The proper fix will require changing the rest of the template setters, removing functionality, which will entail backwards incompatibility, requiring a new major version. I wish they had not introduced this warning, as the functionality is still available until Node 7. I shall think of something soon enough, but will hold off until more reports have arrived about other possible issues, since one can't publish new major versions all the time. cc @bnoordhuis |
cc @nodejs/ctc |
But |
However, it does seem like the signature still takes a |
Well, 5.2 enforces through an assert that the value is not an object, so sooner or later people will have to update their code. It's possible to work around that to some extent using |
Yes, an overload might work. That is probably the best option for keeping consistency between versions, as I don't think |
Using |
Latest v8 disallows setting non-primitive values on v8::Template and derived types. So we no longer can assign v8::Functions directly since it results in a v8 runtime warning reported in #558 [0]. Instead we assign v8::FunctionTemplates. The initial approach of using a bunch of overloads does not cover all cases as was reported in #564 [1] which also discusses the technical reason behind this regression. The new approach employs two auxiliary functions that take an additional argument to discriminate v8::Templates from non-templates. It deals with derived types correctly since the discriminating argument (a pointer) is subject to "normal" conversion rules. The entry point SetMethod(...) "peels off" the handle type using a template-template parameter. This gives access to the "inner type" T. It also deals nicely with the Local<> vs. Handle<> schism which is still an issue with historic node/v8 versions. It also adds tests for both the runtime warning in #558 and the regression from #564. Finally, it tunes "npm test" to show v8 runtime deprecation warnings. This closes #564. [0] #558 [1] #564
Latest v8 disallows setting non-primitive values on v8::Template and derived types. So we no longer can assign v8::Functions directly since it results in a v8 runtime warning reported in #558 [0]. Instead we assign v8::FunctionTemplates. The initial approach of using a bunch of overloads does not cover all cases as was reported in #564 [1] which also discusses the technical reason behind this regression. The new approach employs two auxiliary functions that take an additional argument to discriminate v8::Templates from non-templates. It deals with derived types correctly since the discriminating argument (a pointer) is subject to "normal" conversion rules. The entry point SetMethod(...) "peels off" the handle type using a template-template parameter. This gives access to the "inner type" T. It also deals nicely with the Local<> vs. Handle<> schism which is still an issue with historic node/v8 versions. It also adds tests for both the runtime warning in #558 and the regression from #564. Finally, it tunes "npm test" to show v8 runtime deprecation warnings. This closes #564. [0] #558 [1] #564
Latest v8 disallows setting non-primitive values on v8::Template and derived types. So we no longer can assign v8::Functions directly since it results in a v8 runtime warning reported in #558 [0]. Instead we assign v8::FunctionTemplates. The initial approach of using a bunch of overloads does not cover all cases as was reported in #564 [1] which also discusses the technical reason behind this regression. The new approach employs two auxiliary functions that take an additional argument to discriminate v8::Templates from non-templates. It deals with derived types correctly since the discriminating argument (a pointer) is subject to "normal" conversion rules. The entry point SetMethod(...) "peels off" the handle type using a template-template parameter. This gives access to the "inner type" T. It also deals nicely with the Local<> vs. Handle<> schism which is still an issue with historic node/v8 versions. It also adds tests for both the runtime warning in #558 and the regression from #564. Finally, it tunes "npm test" to show v8 runtime deprecation warnings. This closes #564. [0] nodejs/nan#558 [1] nodejs/nan#564
The default use of
Nan::SetPrototypeMethod
is giving warnings under node 6.0. I had to change from:to:
in order to bypass the warning. It would be nice if SetPrototypeMethod was updated to do this internally.
The text was updated successfully, but these errors were encountered: