diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index a298383d..369f663a 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -2989,16 +2989,20 @@ getJasmineRequireObj().matchersUtil = function(j$) { } var extraKeys = []; - for (var i in allKeys) { - if (!allKeys[i].match(/^[0-9]+$/)) { - extraKeys.push(allKeys[i]); - } + if (allKeys.length === 0) { + return allKeys; + } + + for (var x = 0; x < allKeys.length; x++) { + if (!allKeys[x].match(/^[0-9]+$/)) { + extraKeys.push(allKeys[x]); + } } return extraKeys; } } - + function has(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } diff --git a/src/core/matchers/matchersUtil.js b/src/core/matchers/matchersUtil.js index db1545be..7f17d665 100644 --- a/src/core/matchers/matchersUtil.js +++ b/src/core/matchers/matchersUtil.js @@ -223,16 +223,20 @@ getJasmineRequireObj().matchersUtil = function(j$) { } var extraKeys = []; - for (var i in allKeys) { - if (!allKeys[i].match(/^[0-9]+$/)) { - extraKeys.push(allKeys[i]); - } + if (allKeys.length === 0) { + return allKeys; + } + + for (var x = 0; x < allKeys.length; x++) { + if (!allKeys[x].match(/^[0-9]+$/)) { + extraKeys.push(allKeys[x]); + } } return extraKeys; } } - + function has(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); }