I believe the point of that commit is to help Proto get away from it's
controversial practice of extending native classes and, instead use a more
EcmaScript 5-like approach. Rather than having a thick API where each class
knows how to provide it's own type of JSON, there are simply two
top(ish)-level methods for parsing and unparsing JSON objects.
In EC5, these are JSON.parse and JSON.stringify, respectively.
In Prototype, these are String.evalJSON Object.toJSON, respectively
That said, I'd like to see Prototype be a bit more aggressive about
funneling people toward the EC5 APIs. Now that Proto's implementation is
"EC5 compliant" why not do what http://www.json.org/json2.js does and test
for the presence of the JSON API and, if not found, simply create it? Keep
Object.toJSON and String.evalJSON around for a little while, for backward
compatibility, but in the docs direct people to migrate away from these as
they'll eventually go away (right?)
On Fri, Feb 26, 2010 at 4:36 AM, matti <matti.t.jarvi...@gmail.com> wrote:
> If I'm not completely this should work.
> var a = ['a', 'b', 'c', 'd'];
> var aAsJSON = Object.toJSON(a);
> On Feb 26, 2:28 pm, Mila76 <mil...@gmail.com> wrote:
> > On Feb 26, 10:43 am, Franck WATTEAU <f.watt...@gmail.com> wrote:
> > > Now, the conversion of array in Json String is managed in function
> > > Object#toJSON.
> > I don't see how array is not "extended" anymore
> > var a = ['a', 'b', 'c', 'd'];
> > a.toJSON();
> > result: a.toJson is not a function
> You received this message because you are subscribed to the Google Groups
> "Prototype: Core" group.
> To post to this group, send email to email@example.com
> To unsubscribe from this group, send email to
> For more options, visit this group at
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to firstname.lastname@example.org
To unsubscribe from this group, send email to
For more options, visit this group at