Skip to content

Commit

Permalink
fix Object.{values, entries} for this theoretical case: https://bug…
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Sep 25, 2015
1 parent 3685855 commit bd7eb29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions library/modules/$.object-to-array.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
var $ = require('./$')
, has = require('./$.has')
, toIObject = require('./$.to-iobject');
module.exports = function(isEntries){
return function(it){
var O = toIObject(it)
, keys = $.getKeys(O)
, length = keys.length
, i = 0
, result = Array(length)
, result = []
, key;
if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]];
else while(length > i)result[i] = O[keys[i++]];
while(length > i)has(O, key = keys[i++]) && result.push(isEntries ? [key, O[key]] : O[key]);
return result;
};
};
6 changes: 3 additions & 3 deletions modules/$.object-to-array.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
var $ = require('./$')
, has = require('./$.has')
, toIObject = require('./$.to-iobject');
module.exports = function(isEntries){
return function(it){
var O = toIObject(it)
, keys = $.getKeys(O)
, length = keys.length
, i = 0
, result = Array(length)
, result = []
, key;
if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]];
else while(length > i)result[i] = O[keys[i++]];
while(length > i)has(O, key = keys[i++]) && result.push(isEntries ? [key, O[key]] : O[key]);
return result;
};
};

0 comments on commit bd7eb29

Please sign in to comment.