]> source.dussan.org Git - jquery.git/commitdiff
Back out the try/catch logic from around JSON.parse. We should always try to use...
authorjeresig <jeresig@gmail.com>
Thu, 7 Jan 2010 16:54:26 +0000 (11:54 -0500)
committerjeresig <jeresig@gmail.com>
Thu, 7 Jan 2010 16:54:26 +0000 (11:54 -0500)
src/ajax.js

index 35d83e4fabbbd62aa0d92a8303ef2c587362aade..9b8e800e8bb6c655e499d908ce0b8ede39efc2cb 100644 (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))();
                                }
                        }