jasnell / proposal-istypes

TC-39 Proposal for additional is{Type} APIs
201 stars 7 forks source link

value2 is not property validated in is() #36

Open mrsoto opened 6 years ago

mrsoto commented 6 years ago

I'm not using this lib just reading the source code. Given this I find that the way type of value2 is evaluated in is function had an error.

Is function evaluate if value2 is and object and then evaluate if value1 is a function again.

ljharb commented 6 years ago

If you mean https://github.com/jasnell/proposal-istypes/blob/master/polyfill.js#L136, it does seem like that's a typo.

Either way, the polyfill code in a spec repo isn't meant for production use, it's just an example of how it might be implemented - but it'd be good to fix.