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

chore(IE8) Remove more special code for IE8 #14403

Merged
merged 1 commit into from
Apr 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
16 changes: 0 additions & 16 deletions test/AngularSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<p>" +
"<a name='x'>a</a>" +
"<a name='y'>b</a>" +
"<a name='x'>c</a>" +
"</p>";

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 = [];
Expand Down