1a44a6c8c21b7cc03bfd49c0b395d5034913b3e6b6e47e839d67c92796ab6bedbc752db2ef13b7f597e42639edc5bfdd0615e2e647d2092e2548e46be419b1 729 B

12345678910111213141516171819
  1. 'use strict';
  2. var $export = require('./_export');
  3. var toObject = require('./_to-object');
  4. var toPrimitive = require('./_to-primitive');
  5. var toISOString = require('./_date-to-iso-string');
  6. var classof = require('./_classof');
  7. $export($export.P + $export.F * require('./_fails')(function () {
  8. return new Date(NaN).toJSON() !== null
  9. || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
  10. }), 'Date', {
  11. // eslint-disable-next-line no-unused-vars
  12. toJSON: function toJSON(key) {
  13. var O = toObject(this);
  14. var pv = toPrimitive(O);
  15. return typeof pv == 'number' && !isFinite(pv) ? null :
  16. (!('toISOString' in O) && classof(O) == 'Date') ? toISOString.call(O) : O.toISOString();
  17. }
  18. });