aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/modules/web.dom.iterable.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-05-27 17:36:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-05-27 17:36:13 +0200
commit5f466137ad6ac596600e3ff53c9b786815398445 (patch)
treef914c221874f0b16bf3def7ac01d59d1a99a3b0b /node_modules/core-js/modules/web.dom.iterable.js
parentc9f5ac8e763eda19aa0564179300cfff76785435 (diff)
node_modules, clean up package.json
Diffstat (limited to 'node_modules/core-js/modules/web.dom.iterable.js')
-rw-r--r--node_modules/core-js/modules/web.dom.iterable.js34
1 files changed, 22 insertions, 12 deletions
diff --git a/node_modules/core-js/modules/web.dom.iterable.js b/node_modules/core-js/modules/web.dom.iterable.js
index 94099b8fe..a5a4c08eb 100644
--- a/node_modules/core-js/modules/web.dom.iterable.js
+++ b/node_modules/core-js/modules/web.dom.iterable.js
@@ -1,12 +1,22 @@
-require('./es6.array.iterator');
-var global = require('./$.global')
- , hide = require('./$.hide')
- , Iterators = require('./$.iterators')
- , ITERATOR = require('./$.wks')('iterator')
- , NL = global.NodeList
- , HTC = global.HTMLCollection
- , NLProto = NL && NL.prototype
- , HTCProto = HTC && HTC.prototype
- , ArrayValues = Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array;
-if(NLProto && !NLProto[ITERATOR])hide(NLProto, ITERATOR, ArrayValues);
-if(HTCProto && !HTCProto[ITERATOR])hide(HTCProto, ITERATOR, ArrayValues); \ No newline at end of file
+var $iterators = require('./es6.array.iterator')
+ , redefine = require('./_redefine')
+ , global = require('./_global')
+ , hide = require('./_hide')
+ , Iterators = require('./_iterators')
+ , wks = require('./_wks')
+ , ITERATOR = wks('iterator')
+ , TO_STRING_TAG = wks('toStringTag')
+ , ArrayValues = Iterators.Array;
+
+for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
+ var NAME = collections[i]
+ , Collection = global[NAME]
+ , proto = Collection && Collection.prototype
+ , key;
+ if(proto){
+ if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues);
+ if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
+ Iterators[NAME] = ArrayValues;
+ for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true);
+ }
+} \ No newline at end of file