RE: Elements array and query/queryAll methods

Domenic Denicola <[email protected]>
Newsgroups gmane.comp.web.dom.general
Message-ID <88a5912f1bb2435aaaeacedca22c38a2@BN1PR05MB325.namprd05.prod.outlook.com>
From: [email protected] <[email protected]> on behalf of Anne van Kesteren <[email protected]>

> How does this deal with arr[0] = string?

Indeed. The general problem of creating "typed arrays" is a large one and I don't think array subclasses are well suited to it. (Instead you'd want some kind of exotic proxy.) In general such "typed arrays" are very un-JSey and not the direction we should move in Elements.

Instead, we should act as a normal JS implementation would do, and either fail (throw) or compensate (filter before using). And we should only do that when someone tries to do something with the Elements instance that depends on its contents being Element instances; we should not try to protect ahead of time.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.