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

Commit bb6b627

Browse files
realitykingNarretz
authored andcommitted
chore(IE8) Remove more special code for IE8
1 parent 8dc08fb commit bb6b627

File tree

3 files changed

+4
-26
lines changed

3 files changed

+4
-26
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
}

src/jqLite.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,9 @@ function jqLiteClone(element) {
297297
function jqLiteDealoc(element, onlyDescendants) {
298298
if (!onlyDescendants) jqLiteRemoveData(element);
299299

300-
if (element.querySelectorAll) {
301-
var descendants = element.querySelectorAll('*');
302-
for (var i = 0, l = descendants.length; i < l; i++) {
303-
jqLiteRemoveData(descendants[i]);
304-
}
300+
var descendants = element.querySelectorAll('*');
301+
for (var i = 0, l = descendants.length; i < l; i++) {
302+
jqLiteRemoveData(descendants[i]);
305303
}
306304
}
307305

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)