0
0
mirror of https://github.com/Doodle3D/Doodle3D-API synced 2024-06-27 14:11:21 +02:00
Doodle3D-API/jspm_packages/npm/core-js@0.9.18/modules/$.for-of.js
2015-07-15 15:06:18 +02:00

15 lines
403 B
JavaScript

/* */
var ctx = require("./$.ctx"),
get = require("./$.iter").get,
call = require("./$.iter-call");
module.exports = function(iterable, entries, fn, that) {
var iterator = get(iterable),
f = ctx(fn, that, entries ? 2 : 1),
step;
while (!(step = iterator.next()).done) {
if (call(iterator, f, step.value, entries) === false) {
return call.close(iterator);
}
}
};