babel-plugin-autobind-class-methods
Advanced tools
Comparing version 1.0.1 to 1.0.2
18
index.js
@@ -30,13 +30,6 @@ 'use strict' | ||
var newNodes = methods.map((method)=> | ||
t.assignmentExpression( | ||
"=", | ||
t.memberExpression(t.thisExpression(), method), | ||
t.functionExpression(null,[], | ||
t.blockStatement([ | ||
template('return _makeJsClassGreatAgain(_this, \'' + method.name + '\', arguments)')({}) | ||
]) | ||
) | ||
) | ||
) | ||
var newNodes = methods.map((method)=> { | ||
return template('THIS.METHOD = ()=> _makeJsClassGreatAgain(THIS, \'' + method.name + '\', arguments)')({THIS: t.thisExpression(), METHOD: method}) | ||
} | ||
); | ||
@@ -55,5 +48,2 @@ if (!constructor) { | ||
}) | ||
constructor.get("body").insertAfter(template(`var _this = this;`)({})) | ||
} | ||
@@ -60,0 +50,0 @@ } |
{ | ||
"name": "babel-plugin-autobind-class-methods", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Babel plugin that binds every class method to \"this\" with hot reload support", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3718
41