1 | 'use strict';
|
2 |
|
3 | var uncurryThis = require('../internals/function-uncurry-this');
|
4 | var defineBuiltIn = require('../internals/define-built-in');
|
5 |
|
6 | var DatePrototype = Date.prototype;
|
7 | var INVALID_DATE = 'Invalid Date';
|
8 | var TO_STRING = 'toString';
|
9 | var nativeDateToString = uncurryThis(DatePrototype[TO_STRING]);
|
10 | var thisTimeValue = uncurryThis(DatePrototype.getTime);
|
11 |
|
12 |
|
13 |
|
14 | if (String(new Date(NaN)) !== INVALID_DATE) {
|
15 | defineBuiltIn(DatePrototype, TO_STRING, function toString() {
|
16 | var value = thisTimeValue(this);
|
17 |
|
18 | return value === value ? nativeDateToString(this) : INVALID_DATE;
|
19 | });
|
20 | }
|