Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Work on pages that modify Array.prototype
Browse files Browse the repository at this point in the history
for..in loop used in a client script breaks when page
under the test adds enumerable properties to Array.prototype.

Fixed by replacing for..in with .forEach

Fixes #105
  • Loading branch information
Sergey Tatarintsev committed Jan 27, 2015
1 parent d323baf commit f96f1e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/browser/client-scripts/gemini.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@
results = [],
match;

for (value in values) {
value = values[value];
values.forEach(function(value) {
if ((match = value.match(regex))) {
results.push({
offsetX: parseFloat(match[0]),
Expand All @@ -142,7 +141,8 @@
inset: value.indexOf('inset') !== -1
});
}
}
});

return results;
}

Expand Down

0 comments on commit f96f1e9

Please sign in to comment.