Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 5d695e5

Browse files
realitykingNarretz
authored andcommitted
chore(IE8): remove more special code for IE8
Closes #9478
1 parent 92c3b75 commit 5d695e5

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

src/Angular.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,7 @@ function forEach(obj, iterator, context) {
240240
if (obj) {
241241
if (isFunction(obj)) {
242242
for (key in obj) {
243-
// Need to check if hasOwnProperty exists,
244-
// as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function
245-
if (key !== 'prototype' && key !== 'length' && key !== 'name' &&
246-
(!obj.hasOwnProperty || obj.hasOwnProperty(key))
247-
) {
243+
if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) {
248244
iterator.call(context, obj[key], key, obj);
249245
}
250246
}

test/AngularSpec.js

-16
Original file line numberDiff line numberDiff line change
@@ -1336,22 +1336,6 @@ describe('angular', function() {
13361336
expect(log).toEqual(['0:a', '1:c']);
13371337
});
13381338

1339-
if (document.querySelectorAll) {
1340-
it('should handle the result of querySelectorAll in IE8 as it has no hasOwnProperty function', function() {
1341-
document.body.innerHTML = "<p>" +
1342-
"<a name='x'>a</a>" +
1343-
"<a name='y'>b</a>" +
1344-
"<a name='x'>c</a>" +
1345-
"</p>";
1346-
1347-
var htmlCollection = document.querySelectorAll('[name="x"]'),
1348-
log = [];
1349-
1350-
forEach(htmlCollection, function(value, key) { log.push(key + ':' + value.innerHTML); });
1351-
expect(log).toEqual(['0:a', '1:c']);
1352-
});
1353-
}
1354-
13551339
it('should handle arguments objects like arrays', function() {
13561340
var args,
13571341
log = [];

0 commit comments

Comments
 (0)