Opened 6 years ago
Closed 6 years ago
#18433 closed defect (fixed)
dojo/NodeList-manipulate::text() doesn't return documented result
Reported by: | Michael J Van Sickle | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.11 |
Component: | Core | Version: | 1.10.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The documentation for dojo/NodeList-manipulate::text() say says that it will return the textContent of the first node if no arguments are provided. However, the implementation concatenates the textContent of all of the nodes.
Example: http://jsbin.com/biximuwalu/1/edit?html,console,output per docs, I would expect "foo" to be written to the console, however "foobar" is written
Attachments (1)
Change History (5)
comment:1 Changed 6 years ago by
Owner: | set to Michael J Van Sickle |
---|---|
Status: | new → pending |
comment:2 Changed 6 years ago by
Status: | pending → new |
---|
Correct, the description is correct, but the example is not. Its no sweat to correct the example, just wanted to make sure which is correct.
comment:3 Changed 6 years ago by
Milestone: | tbd → 1.11 |
---|---|
Owner: | changed from Michael J Van Sickle to bill |
Status: | new → assigned |
I see. OK I'll update the example.
The doc in this Nodelist-manipulate.js could use a general cleanup, as half of it looks like it was written by E. E. Cummings, but I'll just fix the doc for that one function.
Changed 6 years ago by
test case for text() corresponding to example in API doc
comment:4 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
That's not what the API doc says, see https://github.com/dojo/dojo/blob/master/NodeList-manipulate.js#L152, which says:
It's also not what the reference doc says, see https://github.com/dojo/docs/blob/master/dojo/NodeList-manipulate.rst#text, which also says:
What doc are you talking about?