#1669 closed defect (fixed)
dojo.dom.hasParent() returns null instead of false
Reported by: | guest | Owned by: | dylan |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Change History (6)
comment:1 Changed 16 years ago by
Milestone: | → 0.4.1 |
---|---|
Owner: | changed from anonymous to dylan |
Status: | new → assigned |
comment:2 Changed 16 years ago by
comment:3 Changed 16 years ago by
Milestone: | 0.4.1 → 0.5 |
---|
Well, we could change
return node && node.parentNode && dojo.dom.isNode(node.parentNode); // boolean
to
return Boolean(node && node.parentNode && dojo.dom.isNode(node.parentNode)); // boolean
Not sure if it's worth it though. I imagine we have dozens of functions that don't return a true boolean value; not sure if we want to change them.
comment:4 Changed 16 years ago by
Milestone: | 0.5 → 0.4.1 |
---|
null should exist but should be "falsey" in boolean situations. While it can't hurt to return a boolean, using the return of htis function today in a boolean scenario will yield the expected behavior.
This bug should not have been moved off of 0.4.1.
comment:5 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
I write this comment here, because bug I've spotted is very near to this improvement. It is IE bug (as far as I understand), but it could be fixed somehow in dojo.
Code:
alerts true in IE7. Without .innerHTML it works fine.
P.S. Sorry about bad english.