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

assert: support arrow functions in .throws() #3276

Merged
merged 1 commit into from
Oct 8, 2015

Commits on Oct 8, 2015

  1. assert: support arrow functions in .throws()

    `x instanceof f` where f is an arrow function throws a (spec-conforming)
    "Function has non-object prototype 'undefined' in instanceof check"
    exception.
    
    Add a workaround so that it's possible to pass arrow functions as the
    second argument to assert.throws().  The try/catch block is a little
    jarring but swapping around the clauses in the if statements changes
    the semantics too much.
    
    Fixes: nodejs#3275
    PR-URL: nodejs#3276
    Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
    Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
    bnoordhuis committed Oct 8, 2015
    Configuration menu
    Copy the full SHA
    ded4f91 View commit details
    Browse the repository at this point in the history