#3244 closed defect (fixed)
Nodelist:: map(), filter() etc. need doc
Reported by: | bill | Owned by: | alex |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Core | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
Not sure if this is intended behavior or not; On IE, Nodelist.map() and similar functions return a simple array, without special methods on it, so you can't do something like:
dojo.query(...).map(...).forEach();
The other problem is that those functions have no inline doc (particularly about the return value).
Change History (8)
comment:1 Changed 15 years ago by
Owner: | changed from anonymous to alex |
---|
comment:2 Changed 15 years ago by
Description: | modified (diff) |
---|---|
Summary: | Nodelist:: map(), filter() etc. methods return arrays not Nodelists, and need doc → Nodelist:: map(), filter() etc. need doc |
comment:3 Changed 15 years ago by
comment:4 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
after much trying, I can't find space-efficient implementations of concat, slice, and splice. I'm marking this closed. We can re-open a new ticket for 1.0 regarding array-compat methods on NodeList?.
comment:5 Changed 15 years ago by
comment:6 Changed 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
OK, so if map() just returns a simple array need to update the comment, right?
// summary: // see dojo.map(). The primary difference is that the acted-on // array is implicitly this NodeList and the return is a // dojo.NodeList (a subclass of Array)
filter() is documented as returning a Nodelist, which is correct.
comment:7 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
no, map returns a NodeList?, as do forEach, style, styles, place, connect, orphan, adopt, and query. Re-closing.
(In [9953]) adding docs for many of the NodeList? methods, adding tests for some of them, improving the code structure in general to make it clear that extending NodeList? is straightforward, and expanding the unit tests to check for return types from NodeList? methods. Still more work to be done there, though. Refs #3244