Skip to content
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

Refactor SetMethod(...) #566

Merged
merged 1 commit into from
May 3, 2016
Merged

Refactor SetMethod(...) #566

merged 1 commit into from
May 3, 2016

Commits on May 2, 2016

  1. 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
    agnat committed May 2, 2016
    Configuration menu
    Copy the full SHA
    8aad6c8 View commit details
    Browse the repository at this point in the history