diff options
| author | 2021-02-03 19:17:50 -0500 | |
|---|---|---|
| committer | 2021-02-03 19:17:50 -0500 | |
| commit | 475d074fd74425efbe783fad08f97f2df0c4909f (patch) | |
| tree | 2acdae53999b3c74b716efa4edb5b40311fa356a /bower_components/jquery/src/ajax/parseJSON.js | |
| parent | cd502d52787f666fff3254d7d7e7578930c813c2 (diff) | |
| parent | 3a0d66f07b112b6d2bdc2b57bbf717a89a351ce6 (diff) | |
Update upstream source from tag 'upstream/8.1.2'
Update to upstream version '8.1.2'
with Debian dir e5e966a9e6010ef70618dc9a61558fa4db35aceb
Diffstat (limited to 'bower_components/jquery/src/ajax/parseJSON.js')
| -rw-r--r-- | bower_components/jquery/src/ajax/parseJSON.js | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/bower_components/jquery/src/ajax/parseJSON.js b/bower_components/jquery/src/ajax/parseJSON.js deleted file mode 100644 index 34efb79..0000000 --- a/bower_components/jquery/src/ajax/parseJSON.js +++ /dev/null @@ -1,53 +0,0 @@ -define( [ - "../core" -], function( jQuery ) { - -var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; - -jQuery.parseJSON = function( data ) { - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - - // Support: Android 2.3 - // Workaround failure to string-cast null input - return window.JSON.parse( data + "" ); - } - - var requireNonComma, - depth = null, - str = jQuery.trim( data + "" ); - - // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains - // after removing valid tokens - return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { - - // Force termination if we see a misplaced comma - if ( requireNonComma && comma ) { - depth = 0; - } - - // Perform no more replacements after returning to outermost depth - if ( depth === 0 ) { - return token; - } - - // Commas must not follow "[", "{", or "," - requireNonComma = open || comma; - - // Determine new depth - // array/object open ("[" or "{"): depth += true - false (increment) - // array/object close ("]" or "}"): depth += false - true (decrement) - // other cases ("," or primitive): depth += true - true (numeric cast) - depth += !close - !open; - - // Remove this token - return ""; - } ) ) ? - ( Function( "return " + str ) )() : - jQuery.error( "Invalid JSON: " + data ); -}; - -return jQuery.parseJSON; - -} ); |
