Skip to content

Commit

Permalink
Update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed May 6, 2014
1 parent 5ca1848 commit 8071b70
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions horde/js/json2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
json2.js
2013-05-26
2014-02-04
Public Domain.
Expand Down Expand Up @@ -45,19 +45,11 @@ if (typeof JSON !== 'object') {
};
}

var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
var cx,
escapable,
gap,
indent,
meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
meta,
rep;


Expand Down Expand Up @@ -209,6 +201,16 @@ if (typeof JSON !== 'object') {
// If the JSON object does not yet have a stringify method, give it one.

if (typeof JSON.stringify !== 'function') {
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
};
JSON.stringify = function (value, replacer, space) {

// The stringify method takes a value and an optional replacer, and an optional
Expand Down Expand Up @@ -256,6 +258,7 @@ if (typeof JSON !== 'object') {
// If the JSON object does not yet have a parse method, give it one.

if (typeof JSON.parse !== 'function') {
cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
JSON.parse = function (text, reviver) {

// The parse method takes a text and an optional reviver function, and returns
Expand Down

0 comments on commit 8071b70

Please sign in to comment.