summaryrefslogtreecommitdiff
path: root/node_modules/@babel/traverse/lib/path/removal.js
diff options
context:
space:
mode:
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() {