On Oct 29, 1:50 pm, Jake Verbaten <
rayn...@gmail.com> wrote:
> Yes they are live, it would be a right pain to make an array live.
>
> My phrasing was vague. I dont want nodelist to _be_ an array. I would like
> to behave like an array (including all the methods).
So for instance:
var nl = document.getElementsByTagName("span");
nl.splice(10, 3, document.createElement('span'));
...should remove the 11th, 12th, and 13th elements and then add in a
blank one? Lots of failure modes and complexity to deal with there,
such as:
var nl = document.getElementsByTagName("span");
nl.splice(10, 3, document.createElement('div'));
Is that an error? It's a *live* `NodeList` of spans, after all, so
adding a div to it seems like an error...
I think trying to require JavaScript `Array` semantics on `NodeList`
objects (which can, of course, be used from other languages) is mixing
problem domains, which is usually not a good idea.
Now, if there are some specific high-value functions you'd like to add
to `NodeList`, that might be a different matter...
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com