_enum-keys.js 469 B

123456789101112131415
  1. // all enumerable object keys, includes symbols
  2. var getKeys = require('./_object-keys');
  3. var gOPS = require('./_object-gops');
  4. var pIE = require('./_object-pie');
  5. module.exports = function (it) {
  6. var result = getKeys(it);
  7. var getSymbols = gOPS.f;
  8. if (getSymbols) {
  9. var symbols = getSymbols(it);
  10. var isEnum = pIE.f;
  11. var i = 0;
  12. var key;
  13. while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  14. } return result;
  15. };