aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/modules/es6.date.to-iso-string.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/core-js/modules/es6.date.to-iso-string.js')
-rw-r--r--node_modules/core-js/modules/es6.date.to-iso-string.js30
1 files changed, 5 insertions, 25 deletions
diff --git a/node_modules/core-js/modules/es6.date.to-iso-string.js b/node_modules/core-js/modules/es6.date.to-iso-string.js
index 2426c5898..13b27818c 100644
--- a/node_modules/core-js/modules/es6.date.to-iso-string.js
+++ b/node_modules/core-js/modules/es6.date.to-iso-string.js
@@ -1,28 +1,8 @@
-'use strict';
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
-var $export = require('./_export')
- , fails = require('./_fails')
- , getTime = Date.prototype.getTime;
-
-var lz = function(num){
- return num > 9 ? num : '0' + num;
-};
+var $export = require('./_export');
+var toISOString = require('./_date-to-iso-string');
// PhantomJS / old WebKit has a broken implementations
-$export($export.P + $export.F * (fails(function(){
- return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z';
-}) || !fails(function(){
- new Date(NaN).toISOString();
-})), 'Date', {
- toISOString: function toISOString(){
- if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value');
- var d = this
- , y = d.getUTCFullYear()
- , m = d.getUTCMilliseconds()
- , s = y < 0 ? '-' : y > 9999 ? '+' : '';
- return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
- '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
- 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
- ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
- }
-}); \ No newline at end of file
+$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
+ toISOString: toISOString
+});