use simple loops always in array comprehensions, support yield inside of array comprehensions - closes #325, fixes #252

This commit is contained in:
Sebastian McKenzie
2015-01-02 02:14:36 +11:00
parent f1a178f8f9
commit ba67f57c1e
10 changed files with 83 additions and 76 deletions

View File

@@ -1,5 +1,12 @@
"use strict";
var arr = [1, 2, 3].map(function (i) {
return i * i;
});
var arr = (function () {
var _arr = [];
for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var i = _step.value;
_arr.push(i * i);
}
return _arr;
})();