massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / es.date.to-string.js
1 var uncurryThis = require('../internals/function-uncurry-this');
2 var redefine = require('../internals/redefine');
3
4 var DatePrototype = Date.prototype;
5 var INVALID_DATE = 'Invalid Date';
6 var TO_STRING = 'toString';
7 var un$DateToString = uncurryThis(DatePrototype[TO_STRING]);
8 var getTime = uncurryThis(DatePrototype.getTime);
9
10 // `Date.prototype.toString` method
11 // https://tc39.es/ecma262/#sec-date.prototype.tostring
12 if (String(new Date(NaN)) != INVALID_DATE) {
13   redefine(DatePrototype, TO_STRING, function toString() {
14     var value = getTime(this);
15     // eslint-disable-next-line no-self-compare -- NaN check
16     return value === value ? un$DateToString(this) : INVALID_DATE;
17   });
18 }