Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#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:


Change History (6)

comment:1 Changed 16 years ago by dylan

Milestone: 0.4.1
Owner: changed from anonymous to dylan
Status: newassigned

comment:2 Changed 16 years ago by [email protected]

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.


var d = document.createElement("div");
d.innerHTML = 'Blah';

alerts true in IE7. Without .innerHTML it works fine.

P.S. Sorry about bad english.

comment:3 Changed 16 years ago by bill


Well, we could change

	return node && node.parentNode && dojo.dom.isNode(node.parentNode);	//	boolean


	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 alex


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 alex

Resolution: fixed
Status: assignedclosed

(In [6531]) fixes #1669

comment:6 Changed 15 years ago by (none)

Milestone: 0.4.1

Milestone 0.4.1 deleted

Note: See TracTickets for help on using tickets.