diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-05-14 14:05:49 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-05-14 14:05:49 +0800 |
| commit | 06823fbf1c2e763a5bf76c3990ca98fbbcd98691 (patch) | |
| tree | 4280bece3888d12a022093bf1a9cd1b049393602 /node_modules/@babel/traverse/lib/path/modification.js | |
| parent | 1368909b3cd552dbb0d12d5863c597f5be46177d (diff) | |
updated node_modules
Diffstat (limited to 'node_modules/@babel/traverse/lib/path/modification.js')
| -rw-r--r-- | node_modules/@babel/traverse/lib/path/modification.js | 13 |
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); |
