node_modules/@babel/traverse/lib/path/removal.js in immosquare-cleaner-0.1.47 vs node_modules/@babel/traverse/lib/path/removal.js in immosquare-cleaner-0.1.48
- old
+ new
@@ -9,29 +9,30 @@
exports._remove = _remove;
exports._removeFromScope = _removeFromScope;
exports.remove = remove;
var _removalHooks = require("./lib/removal-hooks.js");
var _cache = require("../cache.js");
+var _replacement = require("./replacement.js");
var _index = require("./index.js");
var _t = require("@babel/types");
const {
getBindingIdentifiers
} = _t;
function remove() {
var _this$opts;
- this._assertUnremoved();
+ _assertUnremoved.call(this);
this.resync();
- if (!((_this$opts = this.opts) != null && _this$opts.noScope)) {
- this._removeFromScope();
- }
- if (this._callRemovalHooks()) {
- this._markRemoved();
+ if (_callRemovalHooks.call(this)) {
+ _markRemoved.call(this);
return;
}
+ if (!((_this$opts = this.opts) != null && _this$opts.noScope)) {
+ _removeFromScope.call(this);
+ }
this.shareCommentsWithSiblings();
- this._remove();
- this._markRemoved();
+ _remove.call(this);
+ _markRemoved.call(this);
}
function _removeFromScope() {
const bindings = getBindingIdentifiers(this.node, false, false, true);
Object.keys(bindings).forEach(name => this.scope.removeBinding(name));
}
@@ -45,10 +46,10 @@
function _remove() {
if (Array.isArray(this.container)) {
this.container.splice(this.key, 1);
this.updateSiblingKeys(this.key, -1);
} else {
- this._replaceWith(null);
+ _replacement._replaceWith.call(this, null);
}
}
function _markRemoved() {
this._traverseFlags |= _index.SHOULD_SKIP | _index.REMOVED;
if (this.parent) {