Bug 861277 - Uplift addon-sdk's integration branch

This commit is contained in:
Wes Kocher
2013-04-13 17:25:38 -07:00
parent f8c5f44710
commit 3d378e7f12
51 changed files with 1698 additions and 695 deletions

View File

@@ -101,3 +101,15 @@ function fromIterator(iterator) {
return array;
}
exports.fromIterator = fromIterator;
function find(array, predicate) {
var index = 0;
var count = array.length;
while (index < count) {
var value = array[index];
if (predicate(value)) return value;
else index = index + 1;
}
}
exports.find = find;