Opened 12 years ago
Closed 11 years ago
#9487 closed defect (invalid)
dojo.isArray() fails on undefined object properties
Reported by: | theduke | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | General | Version: | 1.3.1 |
Keywords: | base isArray | Cc: | |
Blocked By: | Blocking: |
Description
The summary pretty much says it all.
Example:
var o = { a:'string', b: {} };
dojo.isArray(o.a); returns the string itself dojo.isArray(o.blabla) returns nothing, neither true nor false
Change History (4)
comment:1 Changed 12 years ago by
comment:2 Changed 11 years ago by
we could just add a "!!" to the result instead of returning something truthy/falsey, but none of the other Crockford functions do. I think we're satisfying what the docs say this function does.
comment:3 Changed 11 years ago by
Yah, I would close as wontfix/invalid. I know some people feel strongly claiming that truthy/falsey values are bad but seems fine to me.
comment:4 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
returning nothing == false (though !== false). if you are calling dojo.isArray in a boolean context it behaves correctly. ie.
Undefined is not an array. Testing an defined object property returns a boolean for me. I cant get it to give the wrong answer. Do you have a case where
..would be incorrect?