mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 13:03:18 +00:00
32 lines
1.4 KiB
JavaScript
32 lines
1.4 KiB
JavaScript
var global = require('../internals/global');
|
|
var DOMIterables = require('../internals/dom-iterables');
|
|
var ArrayIteratorMethods = require('../modules/es.array.iterator');
|
|
var hide = require('../internals/hide');
|
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
|
|
var ITERATOR = wellKnownSymbol('iterator');
|
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
var ArrayValues = ArrayIteratorMethods.values;
|
|
|
|
for (var COLLECTION_NAME in DOMIterables) {
|
|
var Collection = global[COLLECTION_NAME];
|
|
var CollectionPrototype = Collection && Collection.prototype;
|
|
if (CollectionPrototype) {
|
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
|
|
hide(CollectionPrototype, ITERATOR, ArrayValues);
|
|
} catch (error) {
|
|
CollectionPrototype[ITERATOR] = ArrayValues;
|
|
}
|
|
if (!CollectionPrototype[TO_STRING_TAG]) hide(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
|
|
if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
|
|
hide(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
|
|
} catch (error) {
|
|
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
|
|
}
|
|
}
|
|
}
|
|
}
|