vendor/assets/javascripts/json2.js in jquery-historyjs-0.2.3 vs vendor/assets/javascripts/json2.js in jquery-historyjs-0.3.0

- old
+ new

@@ -1,8 +1,8 @@ /* - http://www.JSON.org/json2.js - 2011-10-19 + json2.js + 2013-05-26 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. @@ -157,12 +157,11 @@ // Create a JSON object only if one does not already exist. We create the // methods in a closure to avoid creating global variables. -var JSON; -if (!JSON) { +if (typeof JSON !== 'object') { JSON = {}; } (function () { 'use strict'; @@ -172,11 +171,11 @@ return n < 10 ? '0' + n : n; } if (typeof Date.prototype.toJSON !== 'function') { - Date.prototype.toJSON = function (key) { + Date.prototype.toJSON = function () { return isFinite(this.valueOf()) ? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + @@ -186,10 +185,10 @@ : null; }; String.prototype.toJSON = Number.prototype.toJSON = - Boolean.prototype.toJSON = function (key) { + Boolean.prototype.toJSON = function () { return this.valueOf(); }; } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, \ No newline at end of file