File tree 1 file changed +15
-12
lines changed
1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
2
json.js
3
- 2013-05-26
3
+ 2014-02-04
4
4
5
5
Public Domain
6
6
@@ -229,19 +229,11 @@ if (typeof JSON !== 'object') {
229
229
} ;
230
230
}
231
231
232
- var cx = / [ \u0000 \u00ad \u0600 - \u0604 \u070f \u17b4 \u17b5 \u200c - \u200f \u2028 - \u202f \u2060 - \u206f \ufeff \ufff0 - \uffff ] / g ,
233
- escapable = / [ \\ \" \x00 - \x1f \x7f - \x9f \u00ad \u0600 - \u0604 \u070f \u17b4 \u17b5 \u200c - \u200f \u2028 - \u202f \u2060 - \u206f \ufeff \ufff0 - \uffff ] / g ,
232
+ var cx ,
233
+ escapable ,
234
234
gap ,
235
235
indent ,
236
- meta = { // table of character substitutions
237
- '\b' : '\\b' ,
238
- '\t' : '\\t' ,
239
- '\n' : '\\n' ,
240
- '\f' : '\\f' ,
241
- '\r' : '\\r' ,
242
- '"' : '\\"' ,
243
- '\\' : '\\\\'
244
- } ,
236
+ meta ,
245
237
rep ;
246
238
247
239
@@ -392,6 +384,16 @@ if (typeof JSON !== 'object') {
392
384
// If the JSON object does not yet have a stringify method, give it one.
393
385
394
386
if ( typeof JSON . stringify !== 'function' ) {
387
+ escapable = / [ \\ \" \x00 - \x1f \x7f - \x9f \u00ad \u0600 - \u0604 \u070f \u17b4 \u17b5 \u200c - \u200f \u2028 - \u202f \u2060 - \u206f \ufeff \ufff0 - \uffff ] / g;
388
+ meta = { // table of character substitutions
389
+ '\b' : '\\b' ,
390
+ '\t' : '\\t' ,
391
+ '\n' : '\\n' ,
392
+ '\f' : '\\f' ,
393
+ '\r' : '\\r' ,
394
+ '"' : '\\"' ,
395
+ '\\' : '\\\\'
396
+ } ;
395
397
JSON . stringify = function ( value , replacer , space ) {
396
398
397
399
// The stringify method takes a value and an optional replacer, and an optional
@@ -439,6 +441,7 @@ if (typeof JSON !== 'object') {
439
441
// If the JSON object does not yet have a parse method, give it one.
440
442
441
443
if ( typeof JSON . parse !== 'function' ) {
444
+ cx = / [ \u0000 \u00ad \u0600 - \u0604 \u070f \u17b4 \u17b5 \u200c - \u200f \u2028 - \u202f \u2060 - \u206f \ufeff \ufff0 - \uffff ] / g;
442
445
JSON . parse = function ( text , reviver ) {
443
446
444
447
// The parse method takes a text and an optional reviver function, and returns
You can’t perform that action at this time.
0 commit comments