Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
- Loading branch information