On Wed, 29 Apr 2009, John J Barton wrote:
Yes and Firebug has to have special code for HTMLCollection because this
mistake was made in the past. Now we will have to have different special
code for Storage. Rather than modeling new API on old mistakes, consider
learning from the past experience and take a direction that developers
will find less confusing. Pseudo-arrays with "except... this and that"
makes APIs intricate and puzzling. A simpler and less ambiguous
approach would be better in my opinion.
It's not an array or a pseudo-array. It's an enumerable JS host object.
So why call the property |length|? Wouldn't an enumerable JS host
object be just as fabulous with getNumberOfItems()?
Firefox will have to have special code to implement Storage anyway; why is
more special code to show it in Firebug a bad thing? In fact, it's
probably a good thing, since for Storage you probably don't want to be
showing the data in the debugger all the time anyway (since that has
performance implications).
Firebug shows objects from Firefox to developers. The appropriate
display format for objects depends on the character of the objects and
the needs of developers. For example, arrays are shown in square
brackets with the first few entries, ["foo", "bar", ...]. HTML Elements
are shown with their nodeName and id if any. In this way developers
can quickly get an idea of the nature of the object, and perhaps drill
down for more information.