Array Generics and null

Garrett Smith dhtmlkitchen at gmail.com
Sat Mar 22 10:42:02 PDT 2008


 On Sat, Mar 22, 2008 at 9:01 AM, John Resig <jresig at mozilla.com> wrote:
> Hello all -
>

>  It seems like there could be a couple solutions:

Objects that are not capable of running in an Array-generic should not
be attempted to run.

Would it make sense to use - like - for all the Array generics? Is
there an Iterable interface?

Array generic methods will be safer if they check their args and throw
an error - InvalidArgumentError, TypeError, UnlikeError - (whatever).

Invalid: (this will crash Firefox with endless loop):-
Array.forEach( { length : -1, "0": 12 }, iter );

function iter(a) {
  console.log( a );
}

Garrett

>
>  --John
>  _______________________________________________
>  Es4-discuss mailing list
>  Es4-discuss at mozilla.org
>  https://mail.mozilla.org/listinfo/es4-discuss
>



More information about the Es4-discuss mailing list