On Jul 30, 2013, at 2:21 PM, Till Schneidereit wrote:
> On Tue, Jul 30, 2013 at 10:19 PM, Allen Wirfs-Brock <al...@wirfs-brock.com>
> wrote:
> I was really asking about purpose of application level Array.isArray tests.
> What is the application really asking when it uses that test? Is it really
> asking "array-like"? What counts as "array-like"?
>
> My guess is: whether the generic Array methods work for this object. Which is
> a sensible thing to want to know, and which, imo, Array.isArray *seems* to
> provide, if you don't know better.
>
In which case, we are talking about bogus tests because that isn't really what
Array.isArray determines and the generic Array methods will work (to some
degree or another) on any object.
We could define a new predicate Array.isArrayLike with a proxy friendly
extensions mechanism (@@isArrayLike). It wouldn't be the same test as
Array.isArray and the result would be more a statement of intent than an
absolute guarantee.
Would anybody use it? Would it's existence be enough to eliminate the
Array.isArray/proxy concern?
Allen
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss