values.js 606 B

123456789101112131415161718
  1. require('../../modules/web.dom-collections.iterator');
  2. var classof = require('../../internals/classof');
  3. var hasOwn = require('../../internals/has-own-property');
  4. var isPrototypeOf = require('../../internals/object-is-prototype-of');
  5. var method = require('../array/virtual/values');
  6. var ArrayPrototype = Array.prototype;
  7. var DOMIterables = {
  8. DOMTokenList: true,
  9. NodeList: true
  10. };
  11. module.exports = function (it) {
  12. var own = it.values;
  13. return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.values)
  14. || hasOwn(DOMIterables, classof(it)) ? method : own;
  15. };