[orkut-developer] Re: gadgets.json.parse throwing errors

2008-03-04 Thread JevS
Hmm, json2.js from http://swik.net/json/del.icio.us%2Ftag%2Fjson/http%3A%2F%2Fwww.json.org%2Fjson2.js/br2en having same problems- it throws syntax error for blank and invalid input. Since I need JSON.parse to return false instead (as it was in OS couple of days before!), I decided to write my own

[orkut-developer] Re: gadgets.json.parse throwing errors

2008-03-04 Thread JevS
Problems are somewhere in the following code: parse:function(text){ if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\ \\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/ g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){ return eval("("+text+")") }

[orkut-developer] Re: gadgets.json.parse throwing errors

2008-03-04 Thread JevS
Ticket #107 created for gadgets.json.parse issue: http://code.google.com/p/opensocial-resources/issues/detail?id=107&colspec=ID%20Type%20Container%20Stars%20Summary%20Status. Others recent changes for functions gadgets.util.unescapeString, gadgets.util.escape, gadgets.json.parse, gadgets.json.stri

[orkut-developer] Re: gadgets.json.parse throwing errors

2008-03-04 Thread JevS
Jason, I am using data API. Before storing json object I am doing gadgets.json.stringify and then gadgets.util.escape. Then gadgets.util.unescapeString and gadgets.json.parse after reading from database. It was working for few days. Currently having no time to investigate it more. Will try tomorr

[orkut-developer] Re: gadgets.json.parse throwing errors

2008-03-04 Thread Jason
Hi Jevs. Thanks for your report; it sounds like there are two separate issues here, one concerning gadgets.util.unescapeString() and the second for gadgets.json.parse(). If you haven't already, please file them in the OpenSocial issue tracker: http://code.google.com/p/opensocial-resources/wiki/Is

[orkut-developer] Re: gadgets.json.parse throwing errors

2008-03-04 Thread JevS
It looks that json objects are returned from database in the following form "{"id":"18039848908241849583"}", but gadgets.util.unescapeString (new version of it ?) expect them now to be "{"id":"18039848908241849583"}" Then gadgets.json.parse just interrupting any processing. Previousely it was ret