Opened 16 years ago

Closed 16 years ago

#388 closed defect (fixed)

dojo.lang.isArrayLike() fails on undefined and null

Reported by: anonymous Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.2
Keywords: Cc:
Blocked By: Blocking:


below will prevent failure.

dojo.lang.isArrayLike = function(wh) {  
	return (dojo.lang.isArray(wh) ||   // null == undefined
               (!dojo.lang.isString(wh) && wh != null && dojo.lang.isNumberClean(wh.length)))
dojo.lang.isNumberClean(wh) {
        return (dojo.lang.isNumber(wh) && isFinite(wh)); // NaN is not finite

Change History (2)

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

What is isArrayLike suppose to detecting, styleSheets and cssRules? If so then this fixes the failure and does styleSheets:

dojo.lang.isArrayLike = function(wh) { 
return x = (wh && isFinite(wh.length) && (wh instanceof Array || typeof(wh.item) == 'function'));

comment:2 Changed 16 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

Looks like this was fixed a while ago.

Note: See TracTickets for help on using tickets.