* Extract for-of iterator handling to a helper Dis greatly recudes the code size when for-of is used multiple times across the codebase. Also, makes it easier to read what's happening in a compiled loop. * Unify spec and loose code * Legacy implementation fallback * Update tmp var name * Updates from review and after rebase
29 lines
392 B
JavaScript
29 lines
392 B
JavaScript
var _loop = function (i) {
|
|
x = 5;
|
|
({
|
|
f
|
|
} = {
|
|
f: 2
|
|
});
|
|
fns.push(function () {
|
|
return i * x;
|
|
});
|
|
};
|
|
|
|
var _iterator = babelHelpers.createForOfIteratorHelper(nums),
|
|
_step;
|
|
|
|
try {
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
var i = _step.value;
|
|
var x;
|
|
var f;
|
|
|
|
_loop(i);
|
|
}
|
|
} catch (err) {
|
|
_iterator.e(err);
|
|
} finally {
|
|
_iterator.f();
|
|
}
|