From 2bab2859705ed240dd586db2cf5aecbd5c889516 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 25 Feb 2015 11:07:51 +1100 Subject: [PATCH] temporarily disable own binding identification in nameMethod helper - fixes #871 --- lib/babel/transformation/helpers/name-method.js | 2 +- .../spec-function-name/all/expected.js | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/babel/transformation/helpers/name-method.js b/lib/babel/transformation/helpers/name-method.js index 927002b586..cd2d9afe66 100644 --- a/lib/babel/transformation/helpers/name-method.js +++ b/lib/babel/transformation/helpers/name-method.js @@ -47,7 +47,7 @@ var visit = function (node, name, scope) { // check to see if we have a local binding of the id we're setting inside of // the function, this is important as there are caveats associated - var bindingInfo = scope.getOwnBindingInfo(name); + var bindingInfo = null; // todo: proper scope not being passed in es6/classes // scope.getOwnBindingInfo(name); if (bindingInfo) { if (bindingInfo.kind === "param") { diff --git a/test/fixtures/transformation/spec-function-name/all/expected.js b/test/fixtures/transformation/spec-function-name/all/expected.js index 82795f8962..59673b095e 100644 --- a/test/fixtures/transformation/spec-function-name/all/expected.js +++ b/test/fixtures/transformation/spec-function-name/all/expected.js @@ -55,17 +55,7 @@ var g = function g() { }; // param with the same name as id -var h = (function (_h) { - var _hWrapper = function h() { - return _h.apply(this, arguments); - }; - - _hWrapper.toString = function () { - return _h.toString(); - }; - - return _hWrapper; -})(function (h) {}); +var h = function h(h) {}; // assignment to self var i = (function (_i) {