debian-mirror-gitlab/core-js/modules/web.dom-collections.for-each.js

16 lines
691 B
JavaScript
Raw Normal View History

2019-09-25 13:30:05 +05:30
var global = require('../internals/global');
var DOMIterables = require('../internals/dom-iterables');
var forEach = require('../internals/array-for-each');
2019-10-31 01:37:42 +05:30
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
2019-09-25 13:30:05 +05:30
for (var COLLECTION_NAME in DOMIterables) {
var Collection = global[COLLECTION_NAME];
var CollectionPrototype = Collection && Collection.prototype;
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
2019-10-31 01:37:42 +05:30
createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
2019-09-25 13:30:05 +05:30
} catch (error) {
CollectionPrototype.forEach = forEach;
}
}