diff options
author | John Christopher Anderson <jchris@apache.org> | 2010-01-26 00:11:59 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2010-01-26 00:11:59 +0000 |
commit | 8d3b7ab31c1289e1425d1f4f348b7ca0021ab7fe (patch) | |
tree | 5e77f5c042ad40bf02eb5536fa70fb4e54b662c7 /share/www/script/json2.js | |
parent | 5a87b852a72cc36d4d7b64271ed542ce2a1befe0 (diff) |
Replace the old JavaScript query server JSON library with json2.js
This change makes us interoperate better with other JSON implementations. It also means we can use the native JSON handlers in JavaScript runtimes that support them. Should be faster right away on new Spidermonkeys.
There are some potential breaking changes for apps that depend on Couch blowing up on 'undefined'. json2.js serialized undefined as 'null' instead of crashing.
This change will also affect people using E4X, as you can't just return an XML object and have it serialized to a string for you. Calling .toXMLString() on these is all you need to do.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@903023 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/json2.js')
-rw-r--r-- | share/www/script/json2.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/share/www/script/json2.js b/share/www/script/json2.js index 48c55361..39d8f370 100644 --- a/share/www/script/json2.js +++ b/share/www/script/json2.js @@ -1,6 +1,6 @@ /* http://www.JSON.org/json2.js - 2009-08-17 + 2009-09-29 Public Domain. @@ -8,6 +8,14 @@ See http://www.JSON.org/js.html + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. + + This file creates a global JSON object containing two methods: stringify and parse. @@ -136,15 +144,9 @@ This is a reference implementation. You are free to copy, modify, or redistribute. - - This code should be minified before deployment. - See http://javascript.crockford.com/jsmin.html - - USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO - NOT CONTROL. */ -/*jslint evil: true */ +/*jslint evil: true, strict: false */ /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, @@ -153,7 +155,6 @@ test, toJSON, toString, valueOf */ -"use strict"; // Create a JSON object only if one does not already exist. We create the // methods in a closure to avoid creating global variables. |