summaryrefslogtreecommitdiff
path: root/node_modules/@babel/traverse/lib/path/modification.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/traverse/lib/path/modification.js')
-rw-r--r--node_modules/@babel/traverse/lib/path/modification.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/node_modules/@babel/traverse/lib/path/modification.js b/node_modules/@babel/traverse/lib/path/modification.js
index c0a6bec1..3a55cc76 100644
--- a/node_modules/@babel/traverse/lib/path/modification.js
+++ b/node_modules/@babel/traverse/lib/path/modification.js
@@ -112,18 +112,19 @@ function insertAfter(nodes_) {
return isExpression(node) ? expressionStatement(node) : node;
}));
} else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
- if (this.node) {
- const node = this.node;
+ const self = this;
+ if (self.node) {
+ const node = self.node;
let {
scope
} = this;
if (scope.path.isPattern()) {
assertExpression(node);
- this.replaceWith(callExpression(arrowFunctionExpression([], node), []));
- this.get("callee.body").insertAfter(nodes);
- return [this];
+ self.replaceWith(callExpression(arrowFunctionExpression([], node), []));
+ self.get("callee.body").insertAfter(nodes);
+ return [self];
}
- if (isHiddenInSequenceExpression(this)) {
+ if (isHiddenInSequenceExpression(self)) {
nodes.unshift(node);
} else if (isCallExpression(node) && isSuper(node.callee)) {
nodes.unshift(node);