@babel/traverse 7.12.8 → 7.12.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @babel/traverse might be problematic. Click here for more details.

@@ -57,13 +57,13 @@ const hoistVariablesVisitor = {
57
57
  };
58
58
 
59
59
  function replaceWithMultiple(nodes) {
60
+ var _pathCache$get;
61
+
60
62
  this.resync();
61
63
  nodes = this._verifyNodeList(nodes);
62
64
  t.inheritLeadingComments(nodes[0], this.node);
63
65
  t.inheritTrailingComments(nodes[nodes.length - 1], this.node);
64
-
65
- _cache.path.get(this.parent).delete(this.node);
66
-
66
+ (_pathCache$get = _cache.path.get(this.parent)) == null ? void 0 : _pathCache$get.delete(this.node);
67
67
  this.node = this.container[this.key] = null;
68
68
  const paths = this.insertAfter(nodes);
69
69
 
@@ -167,6 +167,8 @@ function replaceWith(replacement) {
167
167
  }
168
168
 
169
169
  function _replaceWith(node) {
170
+ var _pathCache$get2;
171
+
170
172
  if (!this.container) {
171
173
  throw new ReferenceError("Container is falsy");
172
174
  }
@@ -178,6 +180,7 @@ function _replaceWith(node) {
178
180
  }
179
181
 
180
182
  this.debug(`Replace with ${node == null ? void 0 : node.type}`);
183
+ (_pathCache$get2 = _cache.path.get(this.parent)) == null ? void 0 : _pathCache$get2.set(node, this).delete(this.node);
181
184
  this.node = this.container[this.key] = node;
182
185
  }
183
186
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/traverse",
3
- "version": "7.12.8",
3
+ "version": "7.12.9",
4
4
  "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
5
5
  "author": "Sebastian McKenzie <sebmck@gmail.com>",
6
6
  "homepage": "https://babeljs.io/",