RE: Array Like Interface

2009-05-18 Thread Allen Wirfs-Brock
-Original Message- From: Garrett Smith [mailto:dhtmlkitc...@gmail.com] Right. The problem is that that implied interface is not fulfilled in a compatible way IE. IE has list-like host objects which do not work with Array generics, even though those objects appear to support [[Get]] and

RE: Array Like Interface

2009-05-15 Thread Allen Wirfs-Brock
The ES specification implicitly defines such an interface. It is essentially, the union of the requirements that an object must support if it is going to work correctly with the specified generic array methods. Those implicit requirements are fairly basic, but include the standard specified

Re: Array Like Interface

2009-05-15 Thread Brendan Eich
On May 15, 2009, at 10:34 AM, Allen Wirfs-Brock wrote: Note that the host object exceptions in the Es5 spec. permits, but do not require that hosts take liberties with the ES specified object semantics. In particular, there is no reason that a browser cannot implement DOM objects as native

Re: Array Like Interface

2009-05-15 Thread Garrett Smith
On Fri, May 15, 2009 at 10:34 AM, Allen Wirfs-Brock allen.wirfs-br...@microsoft.com wrote: The ES specification implicitly defines such an interface.  It is essentially, the union of the requirements that an object must support if it is going to work correctly with the specified generic array

Array Like Interface

2009-05-14 Thread Garrett Smith
One statement that comes up a lot on comp.lang.javascript is don't trust host objects. There cases where [[ToBoolean]], [[Put]], and [[Get]] throws in IE, but also in Firefox where the property is implemented as a getter, with no setter. The implementation is responsible for ensuring the

Re: Array Like Interface

2009-05-14 Thread Ian Hickson
On Thu, 14 May 2009, Garrett Smith wrote: Implementations could implement this interface for their own interfaces that may be nonstandard, such as window.frames[1] (if that has not made it into Ian Hickson's HTML 5 yet). window.frames === window and is defined here: