Opened 13 years ago

Closed 13 years ago

Last modified 13 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:

Description


Change History (6)

comment:1 Changed 13 years ago by dylan

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

comment:2 Changed 13 years ago by aigors@…

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:

var d = document.createElement("div");
d.innerHTML = 'Blah';
alert(dojo.dom.hasParent(d));

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

P.S. Sorry about bad english.

comment:3 Changed 13 years ago by bill

Milestone: 0.4.10.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 13 years ago by alex

Milestone: 0.50.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 13 years ago by alex

Resolution: fixed
Status: assignedclosed

(In [6531]) fixes #1669

comment:6 Changed 13 years ago by (none)

Milestone: 0.4.1

Milestone 0.4.1 deleted

Note: See TracTickets for help on using tickets.