Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-03 Thread Dmitry A. Soshnikov
On 03.10.2010 1:56, Andrea Giammarchi wrote: this.push.apply(this, [1, 2, 3]); ... , Dmitry, WTF :D this.push(1, 2, 3); easy :P Ah, it was copy-pasted from more generic case when data came from arguments. I still don't like the idea of injectable [[Class]] for user defined objects

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-03 Thread Andrea Giammarchi
I don't know man, I kinda like the possibility, but I am pretty sure we gonna end up trying to figure out via weird tricks if an Array is a native one or not (e.g. Array.isReallyAnArray(obj)) ... however, it's good to have more power than less ;-) Regards, Andrea Giammarchi On Sun, Oct 3,

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-03 Thread Jorge
On 02/10/2010, at 22:51, Brendan Eich wrote: On Oct 2, 2010, at 6:49 AM, Jorge wrote: Why not simply spec an Array.create() ? -no need to redefine what an array is. It's not clear from kangax's blog post that an array with an extra object on its prototype chain before Array.prototype

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-02 Thread Jorge
On 02/10/2010, at 15:29, Brendan Eich wrote: On Sep 6, 2010, at 1:43 AM, Dmitry A. Soshnikov wrote: For what to create a proxy? It's only for catch-traps (yes, it may be used additionally to create a _catcher_ with Array [[Class]], but without additions -- i.e. if a user wants just to

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-02 Thread Dmitry A. Soshnikov
On 02.10.2010 17:29, Brendan Eich wrote: On Sep 6, 2010, at 1:43 AM, Dmitry A. Soshnikov wrote: For what to create a proxy? It's only for catch-traps (yes, it may be used additionally to create a _catcher_ with Array [[Class]], but without additions -- i.e. if a user wants just to inherit

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-02 Thread Alex Russell
On Oct 2, 2010, at 6:49 AM, Jorge wrote: On 02/10/2010, at 15:29, Brendan Eich wrote: On Sep 6, 2010, at 1:43 AM, Dmitry A. Soshnikov wrote: For what to create a proxy? It's only for catch-traps (yes, it may be used additionally to create a _catcher_ with Array [[Class]], but without

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-02 Thread Alex Russell
On Oct 2, 2010, at 10:45 AM, Alex Russell wrote: On Oct 2, 2010, at 6:49 AM, Jorge wrote: On 02/10/2010, at 15:29, Brendan Eich wrote: On Sep 6, 2010, at 1:43 AM, Dmitry A. Soshnikov wrote: For what to create a proxy? It's only for catch-traps (yes, it may be used additionally to

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-02 Thread Brendan Eich
On Oct 2, 2010, at 6:49 AM, Jorge wrote: On 02/10/2010, at 15:29, Brendan Eich wrote: On Sep 6, 2010, at 1:43 AM, Dmitry A. Soshnikov wrote: For what to create a proxy? It's only for catch-traps (yes, it may be used additionally to create a _catcher_ with Array [[Class]], but without

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-02 Thread Dmitry A. Soshnikov
On 03.10.2010 0:58, Dmitry A. Soshnikov wrote: On 03.10.2010 0:51, Brendan Eich wrote: On Oct 2, 2010, at 6:49 AM, Jorge wrote: On 02/10/2010, at 15:29, Brendan Eich wrote: On Sep 6, 2010, at 1:43 AM, Dmitry A. Soshnikov wrote: For what to create a proxy? It's only for catch-traps (yes,

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-02 Thread Andrea Giammarchi
this.push.apply(this, [1, 2, 3]); ... , Dmitry, WTF :D this.push(1, 2, 3); easy :P I still don't like the idea of injectable [[Class]] for user defined objects ... JS follows massive cross libraries approach ... please don't create a chaos even worst than the one we already have with

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-01 Thread Oliver Hunt
I really don't like the idea of using proxies simply to essentially create an array with a custom prototype. My understanding of what is wanted (in terms of subtyping an array) is an ability to have something like var arr = new MyArray() Where 'new MyArray' behaves in essentially the same

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-01 Thread Juriy Zaytsev
On Fri, Oct 1, 2010 at 10:00 PM, Oliver Hunt oli...@apple.com wrote: On Oct 1, 2010, at 6:55 PM, Brendan Eich wrote: On Oct 1, 2010, at 6:24 PM, Oliver Hunt wrote: I really don't like the idea of using proxies simply to essentially create an array with a custom prototype. Implement

Re: not a Date object vs. not an object with [[Class]] of ''Date''

2010-10-01 Thread Tom Van Cutsem
We have previously discussed the Proxy.create(handler, proto, className) design and I think it's feasible. One issue is what should happen to the proxy's [[ClassName]] when it becomes fixed. In the current design, a fixed object proxy can be made indistinguishable from a regular object. That's no