diff --git a/src/Angular.js b/src/Angular.js index 8ee08e4809c7..b83cd072042d 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -213,7 +213,8 @@ function forEach(obj, iterator, context) { if (obj) { if (isFunction(obj)){ for (key in obj) { - if (key != 'prototype' && key != 'length' && key != 'name' && obj.hasOwnProperty(key)) { + // This uglyness around hasOwnProperty is for IE8 to work properly (hasOwnProperty doesn't exist) + if (key != 'prototype' && key != 'length' && key != 'name' && (obj.hasOwnProperty && obj.hasOwnProperty(key) || Object.prototype.hasOwnProperty.call(obj, key))) { iterator.call(context, obj[key], key); } }