From 5d695e5566212d93da0fc1281d5d39ffee0039a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Tue, 7 Oct 2014 22:55:54 +0200 Subject: [PATCH] chore(IE8): remove more special code for IE8 Closes #9478 --- src/Angular.js | 6 +----- test/AngularSpec.js | 16 ---------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index a9a9c124976f..f14b819c53b8 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -240,11 +240,7 @@ function forEach(obj, iterator, context) { if (obj) { if (isFunction(obj)) { for (key in obj) { - // Need to check if hasOwnProperty exists, - // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function - if (key !== 'prototype' && key !== 'length' && key !== 'name' && - (!obj.hasOwnProperty || obj.hasOwnProperty(key)) - ) { + if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) { iterator.call(context, obj[key], key, obj); } } diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 25b8c45284fa..ec334690019d 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -1336,22 +1336,6 @@ describe('angular', function() { expect(log).toEqual(['0:a', '1:c']); }); - if (document.querySelectorAll) { - it('should handle the result of querySelectorAll in IE8 as it has no hasOwnProperty function', function() { - document.body.innerHTML = "

" + - "a" + - "b" + - "c" + - "

"; - - var htmlCollection = document.querySelectorAll('[name="x"]'), - log = []; - - forEach(htmlCollection, function(value, key) { log.push(key + ':' + value.innerHTML); }); - expect(log).toEqual(['0:a', '1:c']); - }); - } - it('should handle arguments objects like arrays', function() { var args, log = [];