summaryrefslogtreecommitdiff
path: root/node_modules/@babel/traverse/lib/path/removal.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-01-04 11:07:54 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-01-04 11:07:54 +0800
commit275f9dc0bdf3e58aa36b800f55f8648fbc55d8af (patch)
tree81c7cf120fb703cfd5e3162f2366033d9fe5c7f8 /node_modules/@babel/traverse/lib/path/removal.js
parent2b4ab36917baef56c7ce1602966f941be15af785 (diff)
upgrade
Diffstat (limited to 'node_modules/@babel/traverse/lib/path/removal.js')
-rw-r--r--node_modules/@babel/traverse/lib/path/removal.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/node_modules/@babel/traverse/lib/path/removal.js b/node_modules/@babel/traverse/lib/path/removal.js
index 7b1ce871..aa61f9a6 100644
--- a/node_modules/@babel/traverse/lib/path/removal.js
+++ b/node_modules/@babel/traverse/lib/path/removal.js
@@ -36,8 +36,10 @@ function _removeFromScope() {
Object.keys(bindings).forEach(name => this.scope.removeBinding(name));
}
function _callRemovalHooks() {
- for (const fn of _removalHooks.hooks) {
- if (fn(this, this.parentPath)) return true;
+ if (this.parentPath) {
+ for (const fn of _removalHooks.hooks) {
+ if (fn(this, this.parentPath)) return true;
+ }
}
}
function _remove() {