View Quote
-
#7281 Up↑ /17 Down↓ [Report] 2014-06-07 01:45 GMT
<fitzgen> should or shouldn't this throw an error? https://gist.github.com/fitzgen/1842c22ffd0d3db33418
<jorendorff> fitzgen: It should throw an error.
<jorendorff> fitzgen: `d instanceof Date` only checks the prototype chain. It does not actually check whether d is an instance of the Date class.
<jorendorff> Here, d is just a plain Object with an unusual prototype.
<jorendorff> fitzgen: Subclassing is coming soon. This sort of thing will be possible without assigning to __proto__. But we're not quite there yet.
<Waldo> fitzgen: Date.prototype.valueOf.call(d) not throwing is enough to verify an actual Date object, for now
<shu> is JS going to get bless?
<Waldo> don't we have plenty of pearls of wisdom of our own to add already?
<jorendorff> you are both fired
<Waldo> \o/
Kindly hosted by jX and in no way affiliated with the Mozilla Foundation.