[Prototype-core] Re: Array toJson

2010-02-26 Thread Tobie Langel
Here's a (not so brief) explanation on the recent changes and the upcoming plans for our JSON API. Our previous JSON implementation was based on Douglas Crockford's original proposal in which primitives, Array and Object prototypes each had their own toJSONString method. We mimicked that behaviour

[Prototype-core] Re: Array toJson

2010-02-26 Thread Mila76
On Feb 26, 2:15 pm, Robert Kieffer wrote: > 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 controversial or not. this "practice" is what prototype is so we expect remove all array extesion? each,

Re: [Prototype-core] Re: Array toJson

2010-02-26 Thread Robert Kieffer
That commit will use the native EC5 apis if they're available. But Prototype doesn't provide them if they're not present, which it easily could do. That's basically what I was suggesting. On Fri, Feb 26, 2010 at 5:48 AM, Walter Lee Davis wrote: > Or maybe continue to provide a layer of spackle

Re: [Prototype-core] Re: Array toJson

2010-02-26 Thread Walter Lee Davis
Or maybe continue to provide a layer of spackle over the differences, by calling the native facility from within the Prototype methods if it's available, and providing the internal method for browsers that haven't caught up to the spec (or are building to their own special spec). Walter

Re: [Prototype-core] Re: Array toJson

2010-02-26 Thread Robert Kieffer
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)-le

[Prototype-core] Re: Array toJson

2010-02-26 Thread matti
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 wrote: > On Feb 26, 10:43 am, Franck WATTEAU wrote: > > > > > Now, the conversion of array in Json String is managed in function > > Object#toJSON. > > I don't see h

[Prototype-core] Re: Array toJson

2010-02-26 Thread Mila76
> > I don't see how array is not "extended" anymore I don't see why array is not "extended" anymore (i know now i can use Object.toJSON) -- Mila76 -- You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototy

[Prototype-core] Re: Array toJson

2010-02-26 Thread Mila76
On Feb 26, 10:43 am, Franck WATTEAU 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

Re: [Prototype-core] Array toJson

2010-02-26 Thread Franck WATTEAU
Hi, Now, the conversion of array in Json String is managed in function Object#toJSON. Franck, On Thu, Feb 25, 2010 at 7:20 PM, Mila76 wrote: > Hi to all, thanks for all work on prototype js. > > I have a simple question, on this submit > > http://github.com/sstephenson/prototype/commit/038a298