MCPcopy Index your code
hub / github.com/react/metro / forEachMapping

Function forEachMapping

packages/metro-source-map/src/generateFunctionMap.js:213–228  ·  view source on GitHub ↗

* Traverses a Babel AST and calls the supplied callback with function name * mappings, one at a time.

(
  ast: BabelNode,
  context: ?Context,
  pushMapping: RangeMapping => void,
)

Source from the content-addressed store, hash-verified

211 * mappings, one at a time.
212 */
213function forEachMapping(
214 ast: BabelNode,
215 context: ?Context,
216 pushMapping: RangeMapping => void,
217) {
218 const visitor = getFunctionMapVisitor(context, pushMapping);
219
220 traverse(ast, {
221 // Our visitor doesn't care about scope
222 noScope: true,
223
224 Function: visitor,
225 Program: visitor,
226 Class: visitor,
227 });
228}
229
230const ANONYMOUS_NAME = '<anonymous>';
231

Callers 2

generateFunctionMapFunction · 0.85

Calls 1

getFunctionMapVisitorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…