Re: [dom] Provide getAttributeNames() which returns an Array<DOMString> (#115)

So getAttributeNames() would return a new sequence<DOMString>  each time?
Are we concerned about silly usage like
for (var i = 0; i < elem.getAttributeNames().length; ++i) {
  // do something with elem.getAttributeNames()[i];
}

It is just that .attributes doesn't change, so fewer new objects there.


Would something like
readonly attribute FrozenArray<DOMString> attributeNames;
work, and in such way that it is replaced with a new array whenever an attribute is added or removed?


But I don't object getAttributeNames().

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/115#issuecomment-159323493

Received on Tuesday, 24 November 2015 16:29:02 UTC