From e2d71f29230cab25516c64490f788314b250f379 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Thu, 10 Sep 2009 09:20:11 -0400 Subject: [PATCH] JSON was overwriting the native JSON.parse and stringify. We wanted to keep those native methods while also keeping JSON as a Hash for compatibility reasons. Since the native methods are marked DontEnum, this is the cleanest way I could think of doing it. Fixes #741 and #607. --- Source/Utilities/JSON.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Utilities/JSON.js b/Source/Utilities/JSON.js index 3c005cb9f..af416fba2 100644 --- a/Source/Utilities/JSON.js +++ b/Source/Utilities/JSON.js @@ -9,8 +9,11 @@ See Also: */ -var JSON = new Hash({ - +var JSON = new Hash(this.JSON && { + stringify: JSON.stringify, + parse: JSON.parse +}).extend({ + $specialChars: {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\'}, $replaceChars: function(chr){