RE: Elements array and query/queryAll methods

From: annevankesteren@gmail.com <annevankesteren@gmail.com> on behalf of Anne van Kesteren <annevk@annevk.nl>

> 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.

Received on Tuesday, 8 April 2014 18:42:12 UTC