update json2.js to 2010-08-25

This commit is contained in:
Mitchell Livingston
2010-10-17 03:07:37 +00:00
parent f42031891f
commit bc6648a06b
2 changed files with 7 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
alert('IMPORTANT: Remove this line from json2.js before deployment.');
/*
http://www.JSON.org/json2.js
2010-03-20
2010-08-25
Public Domain.
@@ -456,10 +456,10 @@ if (!this.JSON) {
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
if (/^[\],:{}\s]*$/.
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
if (/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
@@ -480,4 +480,4 @@ replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
throw new SyntaxError('JSON.parse');
};
}
}());
}());