main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
490 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible');
|
---|
| 4 | var callBound = require('call-bind/callBound');
|
---|
| 5 |
|
---|
| 6 | var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
---|
| 7 | var $push = callBound('Array.prototype.push');
|
---|
| 8 |
|
---|
| 9 | module.exports = function values(O) {
|
---|
| 10 | var obj = RequireObjectCoercible(O);
|
---|
| 11 | var vals = [];
|
---|
| 12 | for (var key in obj) {
|
---|
| 13 | if ($isEnumerable(obj, key)) { // checks own-ness as well
|
---|
| 14 | $push(vals, obj[key]);
|
---|
| 15 | }
|
---|
| 16 | }
|
---|
| 17 | return vals;
|
---|
| 18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.