[Prototype-core] Re: JSON conversion isn't adequate

2007-09-25 Thread Andrew Red
Yeah, yeah, thanks to all. I should have read the RFC thing before even thinking to write about it. (json.org is well-known, thanks) Idea not good. Unless, of course, if someone sees otherwise. Still, I think it was worth bringing your attention to it. Best regards, Andrew Revinsky On Sep

[Prototype-core] Re: JSON conversion isn't adequate

2007-09-25 Thread Tom Gregory
On Sep 25, 2007, at 4:20 PM, Andrew Red wrote: > > To explain the subject line, I believe, the concept of JSON strings > should be described by the following formula: > > eval(obj.toJSON()) -> obj, > > i.e. toJSON methods should return such a string from an object that if > evaluated, the result

[Prototype-core] Re: JSON conversion isn't adequate

2007-09-25 Thread Tobie Langel
> Also consider that JSON is not eval'ed unless the regex > detects that there are no illegal tokens such as function calls that > would open up a script to hacking That's only true if you've passed true to String#evalJSON's sanitize argument - see http://prototypejs.org/api/string/evalJSON for m

[Prototype-core] Re: JSON conversion isn't adequate

2007-09-25 Thread Tobie Langel
Hi, Regarding your first and 3rd point, Prototype's JSON implementation is based on RFC 4627 (http://www.ietf.org/rfc/rfc4627.txt?number=4627) and maps Douglas Crockford's JS implementation (http://json.org/ json.js). JSON is a language agnostic data exchange format which happens to be easily ev

[Prototype-core] Re: JSON conversion isn't adequate

2007-09-25 Thread Ken Snyder
Andrew Red wrote: > ... > 1. Date#toJSON returns a string, if evaluated, it won't become that > same date again: > > I'd like to note that this unit test passes in IE and FF: > testDate: function() {with(this) { > var date = new Date(); > assert((eval('new Date('