metro-source-map 0.73.7 → 0.74.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metro-source-map",
3
- "version": "0.73.7",
3
+ "version": "0.74.0",
4
4
  "description": "🚇 Source map generator for Metro.",
5
5
  "main": "src/source-map.js",
6
6
  "repository": {
@@ -15,14 +15,15 @@
15
15
  "@babel/traverse": "^7.20.0",
16
16
  "@babel/types": "^7.20.0",
17
17
  "invariant": "^2.2.4",
18
- "metro-symbolicate": "0.73.7",
18
+ "metro-symbolicate": "0.74.0",
19
19
  "nullthrows": "^1.1.1",
20
- "ob1": "0.73.7",
20
+ "ob1": "0.74.0",
21
21
  "source-map": "^0.5.6",
22
22
  "vlq": "^1.0.0"
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
+ "@babel/core": "^7.20.0",
26
27
  "@babel/parser": "^7.20.0",
27
28
  "uglify-es": "^3.1.9"
28
29
  }
@@ -108,11 +108,21 @@ function forEachMapping(ast, context, pushMapping) {
108
108
  popFrame();
109
109
  },
110
110
  };
111
+
112
+ // Traversing populates/pollutes the path cache (`traverse.cache.path`) with
113
+ // values missing the `hub` property needed by Babel transformation, so we
114
+ // save, clear, and restore the cache around our traversal.
115
+ // See: https://github.com/facebook/metro/pull/854#issuecomment-1336499395
116
+ const previousCache = _traverse.default.cache.path;
117
+ _traverse.default.cache.clearPath();
111
118
  (0, _traverse.default)(ast, {
119
+ // Our visitor doesn't care about scope
120
+ noScope: true,
112
121
  Function: visitor,
113
122
  Program: visitor,
114
123
  Class: visitor,
115
124
  });
125
+ _traverse.default.cache.path = previousCache;
116
126
  }
117
127
  const ANONYMOUS_NAME = "<anonymous>";
118
128
 
@@ -165,11 +165,21 @@ function forEachMapping(
165
165
  },
166
166
  };
167
167
 
168
+ // Traversing populates/pollutes the path cache (`traverse.cache.path`) with
169
+ // values missing the `hub` property needed by Babel transformation, so we
170
+ // save, clear, and restore the cache around our traversal.
171
+ // See: https://github.com/facebook/metro/pull/854#issuecomment-1336499395
172
+ const previousCache = traverse.cache.path;
173
+ traverse.cache.clearPath();
168
174
  traverse(ast, {
175
+ // Our visitor doesn't care about scope
176
+ noScope: true,
177
+
169
178
  Function: visitor,
170
179
  Program: visitor,
171
180
  Class: visitor,
172
181
  });
182
+ traverse.cache.path = previousCache;
173
183
  }
174
184
 
175
185
  const ANONYMOUS_NAME = '<anonymous>';