move arrow functions transformer to before function names

This commit is contained in:
Sebastian McKenzie 2015-03-19 01:46:53 +11:00
parent ee63fb52b7
commit c3bdecbd25
13 changed files with 24 additions and 24 deletions

View File

@ -8,14 +8,14 @@ export default {
"validation.undeclaredVariableCheck": require("./validation/undeclared-variable-check"), "validation.undeclaredVariableCheck": require("./validation/undeclared-variable-check"),
"validation.react": require("./validation/react"), "validation.react": require("./validation/react"),
// needs to be before `_aliasFunction`
"es6.arrowFunctions": require("./es6/arrow-functions"),
// this goes at the start so we only transform the original user code // this goes at the start so we only transform the original user code
"spec.functionName": require("./spec/function-name"), "spec.functionName": require("./spec/function-name"),
"spec.blockScopedFunctions": require("./spec/block-scoped-functions"), "spec.blockScopedFunctions": require("./spec/block-scoped-functions"),
// needs to be before `_aliasFunction`
"es6.arrowFunctions": require("./es6/arrow-functions"),
reactCompat: require("./other/react-compat"), reactCompat: require("./other/react-compat"),
react: require("./other/react"), react: require("./other/react"),

View File

@ -3,7 +3,7 @@
function one() { function one() {
var _arguments = arguments; var _arguments = arguments;
var inner = function () { var inner = function inner() {
return _arguments; return _arguments;
}; };
return [].slice.call(inner()); return [].slice.call(inner());
@ -13,14 +13,14 @@ one(1, 2);
function two() { function two() {
var _arguments = arguments; var _arguments = arguments;
var inner = function () { var inner = function inner() {
return _arguments; return _arguments;
}; };
var another = function another() { var another = function another() {
var _arguments2 = arguments; var _arguments2 = arguments;
var inner2 = function () { var inner2 = function inner2() {
return _arguments2; return _arguments2;
}; };
}; };
@ -32,7 +32,7 @@ two(1, 2);
function three() { function three() {
var _arguments = arguments; var _arguments = arguments;
var fn = function () { var fn = function fn() {
return _arguments[0] + "bar"; return _arguments[0] + "bar";
}; };
return fn(); return fn();
@ -42,7 +42,7 @@ three("foo");
function four() { function four() {
var _arguments = arguments; var _arguments = arguments;
var fn = function () { var fn = function fn() {
return _arguments[0].foo + "bar"; return _arguments[0].foo + "bar";
}; };
return fn(); return fn();

View File

@ -1,6 +1,6 @@
"use strict"; "use strict";
var some = function () { var some = function some() {
var count = arguments[0] === undefined ? "30" : arguments[0]; var count = arguments[0] === undefined ? "30" : arguments[0];
console.log("count", count); console.log("count", count);

View File

@ -1,6 +1,6 @@
"use strict"; "use strict";
var a = function (_ref) { var a = function a(_ref) {
var target = _ref.target; var target = _ref.target;
return console.log(target); return console.log(target);
}; };

View File

@ -1,5 +1,5 @@
"use strict"; "use strict";
var t = function () { var t = function t() {
return 5 + 5; return 5 + 5;
}; };

View File

@ -1,3 +1,3 @@
"use strict"; "use strict";
var t = function () {}; var t = function t() {};

View File

@ -1,5 +1,5 @@
"use strict"; "use strict";
var t = function (i, x) { var t = function t(i, x) {
return i * x; return i * x;
}; };

View File

@ -1,5 +1,5 @@
"use strict"; "use strict";
var t = function (i) { var t = function t(i) {
return i * 5; return i * 5;
}; };

View File

@ -1,5 +1,5 @@
"use strict"; "use strict";
var t = function (i) { var t = function t(i) {
return i * 5; return i * 5;
}; };

View File

@ -3,7 +3,7 @@
function b() { function b() {
var _this = this; var _this = this;
var t = function (x) { var t = function t(x) {
return _this.x + x; return _this.x + x;
}; };
} }

View File

@ -1,6 +1,6 @@
"use strict"; "use strict";
var concat = function () { var concat = function concat() {
var x = arguments[0]; var x = arguments[0];
var y = arguments[1]; var y = arguments[1];
}; };
@ -8,18 +8,18 @@ var concat = function () {
var somefun = function somefun() { var somefun = function somefun() {
var _arguments = arguments; var _arguments = arguments;
var get2ndArg = function (a, b) { var get2ndArg = function get2ndArg(a, b) {
var _b = arguments[2]; var _b = arguments[2];
var somef = function (x, y, z) { var somef = function somef(x, y, z) {
var _a = arguments[3]; var _a = arguments[3];
}; };
var somefg = function (c, d, e, f) { var somefg = function somefg(c, d, e, f) {
var _a = arguments[4]; var _a = arguments[4];
}; };
var _c = _arguments[1]; var _c = _arguments[1];
var _d = arguments[3]; var _d = arguments[3];
}; };
var get1stArg = function () { var get1stArg = function get1stArg() {
return arguments[0]; return arguments[0];
}; };
}; };

View File

@ -1,5 +1,5 @@
"use strict"; "use strict";
var t = function (x) { var t = function t(x) {
return x * x; return x * x;
}; };

View File

@ -1,5 +1,5 @@
"use strict"; "use strict";
var foo = function () { var foo = function foo() {
return undefined; return undefined;
}; };