| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
LGTM. Two weeks back I faced the same problem and tried the exact same fix locally :D |
Sorry, something went wrong.
|
Isn't it enough to do if(expected.prototype && actual instanceof expected) if you don't want the try/catch ? |
Sorry, something went wrong.
|
@targos Wouldn't it be better if we let v8 take care of it? |
Sorry, something went wrong.
|
What @thefourtheye said. I'm inclined to be reactive here, not proactive. An explicit check like that can be subverted. |
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: there are two white spaces between both sentences.
Sorry, something went wrong.
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.
Sorry, something went wrong.
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)
Sorry, something went wrong.
|
OK then LGTM |
Sorry, something went wrong.
`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 ... should this land in v4.x before LTS is cut? |
Sorry, something went wrong.
|
Good point. Yes, tag added. |
Sorry, something went wrong.
`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>
| Back | FazBrowse Home | New Git URL |
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
R=@thefourtheye
CI: https://ci.nodejs.org/job/node-test-pull-request/453/