Socket
Socket
Sign inDemoInstall

babel-plugin-autobind-class-methods

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.1.0

48

lib/index.js

@@ -13,2 +13,9 @@ "use strict";

ClassExpression: function ClassExpression(path, state) {
var findBareSupers = {
Super: function Super(path) {
if (path.parentPath.isCallExpression({ callee: path.node })) {
this.push(path.parentPath);
}
}
};
var isDerived = !!path.node.superClass;

@@ -72,5 +79,40 @@ var constructor = void 0;

newNodes.forEach(function (node) {
constructor.node.body.body.push(node);
});
if (isDerived) {
var bareSupers = [];
constructor.traverse(findBareSupers, bareSupers);
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
var _loop = function _loop() {
var bareSuper = _step2.value;
newNodes.forEach(function (node) {
bareSuper.insertAfter(node);
});
};
for (var _iterator2 = bareSupers[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
_loop();
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2.return) {
_iterator2.return();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
} else {
newNodes.forEach(function (node) {
constructor.get("body").unshiftContainer("body", node);
});
}
}

@@ -77,0 +119,0 @@ }

2

package.json
{
"name": "babel-plugin-autobind-class-methods",
"version": "2.0.0",
"version": "2.1.0",
"description": "Babel plugin that binds every class method to \"this\" with hot reload support",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc