Version 1
[yaffs-website] / node_modules / core-js / modules / es6.date.to-string.js
diff --git a/node_modules/core-js/modules/es6.date.to-string.js b/node_modules/core-js/modules/es6.date.to-string.js
new file mode 100644 (file)
index 0000000..686e949
--- /dev/null
@@ -0,0 +1,11 @@
+var DateProto    = Date.prototype
+  , INVALID_DATE = 'Invalid Date'
+  , TO_STRING    = 'toString'
+  , $toString    = DateProto[TO_STRING]
+  , getTime      = DateProto.getTime;
+if(new Date(NaN) + '' != INVALID_DATE){
+  require('./_redefine')(DateProto, TO_STRING, function toString(){
+    var value = getTime.call(this);
+    return value === value ? $toString.call(this) : INVALID_DATE;
+  });
+}
\ No newline at end of file