Merge pull request #6481 from nicolo-ribaudo/fn-bind-dupl-nodes-6458

Don't insert duplicated nodes when transforming function bind
This commit is contained in:
Sven SAULEAU 2017-10-14 15:49:55 +02:00 committed by GitHub
commit 0951720a81
4 changed files with 14 additions and 1 deletions

View File

@ -16,7 +16,7 @@ export default function({ types: t }) {
function inferBindContext(bind, scope) {
const staticContext = getStaticContext(bind, scope);
if (staticContext) return staticContext;
if (staticContext) return t.cloneDeep(staticContext);
const tempId = getTempId(scope);
if (bind.object) {

View File

@ -0,0 +1,3 @@
import Obj from "./file";
console.log(::Obj.method);

View File

@ -0,0 +1,7 @@
"use strict";
var _file = _interopRequireDefault(require("./file"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
console.log(_file.default.method.bind(_file.default));

View File

@ -0,0 +1,3 @@
{
"plugins": ["transform-function-bind", "transform-es2015-modules-commonjs"]
}