* walk objects and arrays * @param {Object} obj * @param {Function} iterator * @param {Object} context
(obj, iterator, context)
| 92519 | * @param {Function} iterator |
| 92520 | * @param {Object} context |
| 92521 | */ function each(obj, iterator, context) { |
| 92522 | var i; |
| 92523 | if (!obj) return; |
| 92524 | if (obj.forEach) obj.forEach(iterator, context); |
| 92525 | else if (obj.length !== undefined) { |
| 92526 | i = 0; |
| 92527 | while(i < obj.length){ |
| 92528 | iterator.call(context, obj[i], i, obj); |
| 92529 | i++; |
| 92530 | } |
| 92531 | } else for(i in obj)obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj); |
| 92532 | } |
| 92533 | /** |
| 92534 | * wrap a method with a deprecation warning and stack trace |
| 92535 | * @param {Function} method |
no test coverage detected