diff --git a/JSON.prune.js b/JSON.prune.js index 1137487..efb3aac 100644 --- a/JSON.prune.js +++ b/JSON.prune.js @@ -45,7 +45,9 @@ forEachProperty(Object.getPrototypeOf(obj), callback, excluded); }; - Object.defineProperty(Date.prototype, "toPrunedJSON", {value:Date.prototype.toJSON}); + if (typeof Date.prototype.toPrunedJSON === "undefined") { + Object.defineProperty(Date.prototype, "toPrunedJSON", {value:Date.prototype.toJSON}); + } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,