-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor SetMethod() to deal with v8::Templates
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
- Loading branch information
Showing
3 changed files
with
43 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters