From 152b8eb7e9d751ea23ca038a6ef50c807da14773 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Mon, 7 Nov 2016 20:36:25 -0500 Subject: [PATCH] Remove function-name transform. This transform takes the liberty of renaming local variables so they don't collide with the names of functions and function-valued properties, which doesn't seem even remotely safe to me, especially considering that function.name is merely a convenience for several other ways of getting the name of the current function, and has not proven to be a widely used ECMAScript feature. This transform can be added back via .babelrc if desired, as long as you don't mind your variables being renamed. --- index.js | 1 - package.json | 1 - 2 files changed, 2 deletions(-) diff --git a/index.js b/index.js index 5547f272b6..1aefc14a5a 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,6 @@ module.exports = { [require("babel-plugin-transform-es2015-for-of"), { loose: true }], - require("babel-plugin-transform-es2015-function-name"), require("babel-plugin-transform-es2015-literals"), require("babel-plugin-transform-es2015-object-super"), require("babel-plugin-transform-es2015-parameters"), diff --git a/package.json b/package.json index 4f139ef10b..cf7011a051 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "babel-plugin-transform-es2015-computed-properties": "^6.8.0", "babel-plugin-transform-es2015-destructuring": "^6.16.0", "babel-plugin-transform-es2015-for-of": "^6.8.0", - "babel-plugin-transform-es2015-function-name": "^6.9.0", "babel-plugin-transform-es2015-literals": "^6.8.0", "babel-plugin-transform-es2015-object-super": "^6.8.0", "babel-plugin-transform-es2015-parameters": "^6.17.0",