Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14566 closed bug (notabug)

each function does not check object is iterable

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:


$.each(obj, function(index, value){

If obj is not an Array or not a String or not an Object, it will raise an error like "Uncaught TypeError: Cannot read property 'length' of undefined ".

I think before define "length=object.length" will check object type.

Change History (1)

comment:1 Changed 9 years ago by dmethvin

Resolution: notabug
Status: newclosed

That would make debugging harder if we covered up mistakes. Pass in valid arguments.

Note: See TracTickets for help on using tickets.