PDA

View Full Version : [FIXED][3.0rc1] Json decode calls incorrect method stringify if isNative



durlabh
15 Apr 2009, 12:06 PM
IMHO, in Json.js,



this.decode = isNative ? JSON.stringify : function(json){
return eval("(" + json + ')');
};


should read as:



this.decode = isNative ? JSON.parse : function(json){
return eval("(" + json + ')');
};

evant
15 Apr 2009, 12:14 PM
Fixed in SVN, thanks.

durlabh
15 Apr 2009, 12:21 PM
Check at the top for native JSON object also looks incorrect. Right now code checks for:



JSON.toString == '[object JSON]'


Instead, it should be:


JSON.toString() == '[object JSON]'