MCPcopy
hub / github.com/react/metro / push

Method push

packages/metro-source-map/src/generateFunctionMap.js:545–564  ·  view source on GitHub ↗
({name, start}: RangeMapping)

Source from the content-addressed store, hash-verified

543 }
544
545 push({name, start}: RangeMapping) {
546 let nameIndex = this._namesMap.get(name);
547 if (typeof nameIndex !== 'number') {
548 nameIndex = this._names.length;
549 this._names[nameIndex] = name;
550 this._namesMap.set(name, nameIndex);
551 }
552 const lineDelta = this._line.next(start.line);
553 const firstOfLine = this._mappings.pos === 0 || lineDelta > 0;
554 if (lineDelta > 0) {
555 // The next entry will have the line offset, so emit just one semicolon.
556 this._mappings.markLines(1);
557 this._column.reset(0);
558 }
559 this._mappings.startSegment(this._column.next(start.column));
560 this._mappings.append(this._nameIndex.next(nameIndex));
561 if (firstOfLine) {
562 this._mappings.append(lineDelta);
563 }
564 }
565}
566
567class RelativeValue {

Callers 15

generateFunctionMapFunction · 0.95
functionMapBabelPluginFunction · 0.95
constructorMethod · 0.80
#applyFileDeltaMethod · 0.80
enqueueEventMethod · 0.80
constructorMethod · 0.80
processBatchMethod · 0.80
#getWorkerInputMethod · 0.80
#lookupByNormalPathMethod · 0.80
hierarchicalLookupMethod · 0.80
rootRelativeCacheKeysFunction · 0.80

Calls 7

markLinesMethod · 0.80
startSegmentMethod · 0.80
getMethod · 0.65
setMethod · 0.65
nextMethod · 0.45
resetMethod · 0.45
appendMethod · 0.45

Tested by 6

executeFunction · 0.64
visitFunction · 0.64
executeFunction · 0.64
addInferredDependencyFunction · 0.64
reportFatalErrorFunction · 0.64
collectWatchEventsFunction · 0.64