[whatwg] Adding ECMAScript 5 array extras to HTMLCollection

Oliver Hunt oliver at apple.com
Thu Aug 5 10:37:41 PDT 2010


On Aug 4, 2010, at 6:26 PM, Garrett Smith wrote:

> On 8/4/10, Oliver Hunt <oliver at apple.com> wrote:
>> 
>> On Aug 4, 2010, at 3:32 PM, Garrett Smith wrote:
>> 
>>> On 8/4/10, Garrett Smith <dhtmlkitchen at gmail.com> wrote:
>>> 
>>> [...]
>>>> "submitButton" in form.elements
>>>> 
>>>> Existing implementations vary on when they use catchalls. I'd like to
>>>> see standardization for this behavior and codification so that
>>>> implementations behave similarly -- either use a catchall for a
>>>> particular type of collection or use a native object. If a catchall is
>>> 
>>> Native object either way, but either with a new ES catchall behavior
>>> or with a native ES object, as specified today.
>>> 
>>> Garrett
>> As a question, if the node lists were implemented as catchalls, how would
>> the behaviour differ from current NodeLists?
> 

So your only desire is to have NodeLists lose the host object issues?

> 
> The only change I can see
>> would be the loss of the host object exceptions in the ES spec, but that
>> just puts you in the position of having semantics that match the current
>> host object behavior in those implementations that already allow array
>> functions to operate on host objects.
>> 
> 
> The semantics for native object are defined by ECMA-262.
> 
> If collection is required to be implemented as a native ECMAScript
> object, then it would still be considered a host as a native object,
> would be indistinguishable from other native objects, both internally
> and externally, and so would not be subject to ES "whether or not the
> xxx method may be applied to a host object" loopholes. Thus,
> 
>  [].slice.call( ho )

It sounds like all you want is for the array (and other similar) methods to work on NodeLists, etc but currently some implementations make use of the ES5 text saying the they don't need to support host objects, correct?

An ES definition for the type would merely be for the purpose of removing the ability for an implementation to make use of the "we don't need to support operation X on host objects"?

--Oliver





More information about the whatwg mailing list