It's well known that in order to take advantage of native JSON
libraries in the newest Mozilla JavaScript VMs, we'll need to change
our handling of 'undefined' in the toJSON() routine.

I propose we make this change now, by replacing our current JSON
handling with json2.js, the current reference implementation.

I've started the work here:

http://github.com/jchris/couchdb/tree/json2

Everything works except E4X. When I run the view_xml tests, I see this
error in the logs:

OS Process :: function raised exception (TypeError:
String.prototype.toJSON called on incompatible XML) with doc._id
43840f81289e03fec4e9f620b2c03799

In our old implementation of toJSON, we run value.toXMLString() to
convert XML to strings. json2.js takes a callback parameter to allow
modification of results, but the TypeError is triggered before the
callback, it seems.

If any of you JavaScript ninjas wanna give this a shot, please help me
finish it.

Chris

-- 
Chris Anderson
http://jchrisa.net
http://couch.io

Reply via email to