canjs / can-util

Essential utilities used by lots of CanJS's projects.
https://canjs.com/doc/can-util.html
MIT License
10 stars 8 forks source link

Why obj == obj.window BUT NOT 'eqeqeq' #443

Closed afeiship closed 5 years ago

afeiship commented 5 years ago

https://github.com/canjs/can-util/blob/c4831a0e4aa58710f421b3b5331a73dca8798df3/js/is-plain-object/is-plain-object.js#L10

chasenlehara commented 5 years ago

Hi @afeiship, I’m not sure I understand your question.

The jshint eqeqeq:false comment is to disable JSHint’s check for ===, because == is needed for that line (thanks to IE8… can-util doesn’t support it anymore, so we could probably remove that comment and make the check ===).

https://github.com/canjs/can-util/blob/c4831a0e4aa58710f421b3b5331a73dca8798df3/js/is-plain-object/is-plain-object.js#L8-L10

afeiship commented 5 years ago

@chasenlehara // In IE8 window.window !== window.window, so we allow == here Thanks, that is my question. (For ie8)