dry up array comprehension and arrow functions by introducing an alias-functions transformer

This commit is contained in:
Sebastian McKenzie
2014-10-13 05:35:26 +11:00
parent a6ffde6e9b
commit 3d2c41bb5a
10 changed files with 132 additions and 81 deletions

View File

@@ -1,6 +1,6 @@
function add() {
var _arguments = arguments;
return [1, 2, 3].map(function () {
return [1, 2, 3].map(function (i) {
return i * _arguments[0];
});
}

View File

@@ -1,6 +1,6 @@
function add() {
var _this = this;
return [1, 2, 3].map(function () {
return [1, 2, 3].map(function (i) {
return i * _this.multiplier;
});
}