On Oct 10, 2007, at 3:53 PM, Garrett Smith wrote:

> Typechecking is a problem.
>
> typeof is limited and allows host objects to return anything. The
> problem is that some host objects return "function", for example, a
> NodeList in Safari. This is perfectly legal, according to the spec.

See http://bugs.ecmascript.org/ticket/153 -- for a general, universal  
is-it-callable test, you would write

   if (it is Callable) ...

> How is type checking addressed in ES4?

The |is| operator tests universal or Platonic type, which involves  
shared, immutable type descriptors that do not vary across windows or  
frames. So

   if (a is Array) ...

will work no matter where a was constructed.

/be

_______________________________________________
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to