Uh oh!
There was an error while loading. Please reload this page.
assert: support arrow functions in .throws() - #3276
Conversation
thefourtheye
commented
Oct 8, 2015
LGTM. Two weeks back I faced the same problem and tried the exact same fix locally :D |
targos
commented
Oct 8, 2015
Isn't it enough to do |
thefourtheye
commented
Oct 8, 2015
@targos Wouldn't it be better if we let v8 take care of it? |
bnoordhuis
commented
Oct 8, 2015
What @thefourtheye said. I'm inclined to be reactive here, not proactive. An explicit check like that can be subverted. |
There was a problem hiding this comment.
Nit: there are two white spaces between both sentences.
There was a problem hiding this comment.
You may have noticed that I do that in most places. It's called double spacing and religious wars have been fought over whether or not it's a good thing.
There was a problem hiding this comment.
Double spacing is spacing between lines... I think you guys are referring to the spaces after the period, in the comment? (maybe not; then please ignore this comment)
targos
commented
Oct 8, 2015
OK then LGTM |
`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>
jasnell
commented
Oct 9, 2015
@bnoordhuis ... should this land in v4.x before LTS is cut? |
bnoordhuis
commented
Oct 9, 2015
Good point. Yes, tag added. |
`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: #3275 PR-URL: #3276 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
jasnell
commented
Oct 10, 2015
Landed in v4.x in 8383c4f |
x instanceof fwhere 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: #3275
R=@thefourtheye
CI: https://ci.nodejs.org/job/node-test-pull-request/453/