Back out the try/catch logic from around JSON.parse. We should always try to use it, otherwise security will suffer.

This commit is contained in:
jeresig 2010-01-07 11:54:26 -05:00
parent c68fbc2071
commit c14fa516ae

View file

@ -578,10 +578,10 @@ jQuery.extend({
// Get the JavaScript object, if JSON is used.
if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
// Try to use the native JSON parser first
try {
data = JSON.parse( data );
if ( window.JSON && window.JSON.parse ) {
data = window.JSON.parse( data );
} catch(e) {
} else {
data = (new Function("return " + data))();
}
}