Skip to content

Commit

Permalink
Date#toJSON should check context on finite, WebKit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Jan 28, 2016
1 parent 1484988 commit f97bb26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/modules/es6.date.to-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var $export = require('./_export')
, toPrimitive = require('./_to-primitive');

$export($export.P + $export.F * require('./_fails')(function(){
return Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
toJSON: function toJSON(key){
var O = toObject(this)
Expand Down
2 changes: 1 addition & 1 deletion modules/es6.date.to-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var $export = require('./_export')
, toPrimitive = require('./_to-primitive');

$export($export.P + $export.F * require('./_fails')(function(){
return Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
toJSON: function toJSON(key){
var O = toObject(this)
Expand Down

0 comments on commit f97bb26

Please sign in to comment.