2017-08-14 05:01:11 +02:00
|
|
|
var DateProto = Date.prototype;
|
|
|
|
var INVALID_DATE = 'Invalid Date';
|
|
|
|
var TO_STRING = 'toString';
|
|
|
|
var $toString = DateProto[TO_STRING];
|
|
|
|
var getTime = DateProto.getTime;
|
|
|
|
if (new Date(NaN) + '' != INVALID_DATE) {
|
|
|
|
require('./_redefine')(DateProto, TO_STRING, function toString() {
|
2017-05-27 17:36:13 +02:00
|
|
|
var value = getTime.call(this);
|
2017-08-14 05:01:11 +02:00
|
|
|
// eslint-disable-next-line no-self-compare
|
2016-10-10 03:43:44 +02:00
|
|
|
return value === value ? $toString.call(this) : INVALID_DATE;
|
|
|
|
});
|
2017-08-14 05:01:11 +02:00
|
|
|
}
|