implementation.js 491 B

123456789101112131415161718
  1. 'use strict';
  2. var RequireObjectCoercible = require('es-abstract/2021/RequireObjectCoercible');
  3. var callBound = require('call-bind/callBound');
  4. var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
  5. var $push = callBound('Array.prototype.push');
  6. module.exports = function values(O) {
  7. var obj = RequireObjectCoercible(O);
  8. var vals = [];
  9. for (var key in obj) {
  10. if ($isEnumerable(obj, key)) { // checks own-ness as well
  11. $push(vals, obj[key]);
  12. }
  13. }
  14. return vals;
  15. };