W3C home > Mailing lists > Public > public-html@w3.org > April 2014

RE: Elements array and query/queryAll methods

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Tue, 8 Apr 2014 18:41:26 +0000
To: Anne van Kesteren <annevk@annevk.nl>, Rick Waldron <waldron.rick@gmail.com>
CC: Dean Edwards <dean.edwards@gmail.com>, Travis Leithead <travis.leithead@microsoft.com>, Eric Devine <devineej@gmail.com>, "public-html@w3.org" <public-html@w3.org>, "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <88a5912f1bb2435aaaeacedca22c38a2@BN1PR05MB325.namprd05.prod.outlook.com>
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:19 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:38 UTC