_getSymbols.js 669 B

123456789101112131415161718192021222324
  1. var stubArray = require('./stubArray');
  2. /** Built-in value references. */
  3. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  4. /**
  5. * Creates an array of the own enumerable symbol properties of `object`.
  6. *
  7. * @private
  8. * @param {Object} object The object to query.
  9. * @returns {Array} Returns the array of symbols.
  10. */
  11. function getSymbols(object) {
  12. // Coerce `object` to an object to avoid non-object errors in V8.
  13. // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details.
  14. return getOwnPropertySymbols(Object(object));
  15. }
  16. // Fallback for IE < 11.
  17. if (!getOwnPropertySymbols) {
  18. getSymbols = stubArray;
  19. }
  20. module.exports = getSymbols;