Skip to content

Commit

Permalink
Update packages/babel-traverse/src/path/replacement.js
Browse files Browse the repository at this point in the history
Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com>
  • Loading branch information
JLHwung and nicolo-ribaudo committed Nov 24, 2020
1 parent 04d106c commit 9b91f0f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/babel-traverse/src/path/replacement.js
Expand Up @@ -199,11 +199,7 @@ export function _replaceWith(node) {
}

this.debug(`Replace with ${node?.type}`);
const cache = pathCache.get(this.parent);
if (cache) {
cache.set(node, this);
cache.delete(this.node);
}
pathCache.get(this.parent)?.set(node, this).delete(this.node);

this.node = this.container[this.key] = node;
}
Expand Down

0 comments on commit 9b91f0f

Please sign in to comment.