MCPcopy Create free account
hub / github.com/babel/babel / source

Method source

packages/babel-generator/src/buffer.ts:346–352  ·  view source on GitHub ↗

* Sets a given position as the current source location so generated code after this call * will be given this position in the sourcemap.

(prop: "start" | "end", loc: Loc)

Source from the content-addressed store, hash-verified

344 */
345
346 source(prop: "start" | "end", loc: Loc): void {
347 if (!this._map) return;
348
349 // Since this is called extremely often, we reuse the same _sourcePosition
350 // object for the whole lifetime of the buffer.
351 this._normalizePosition(prop, loc, 0);
352 }
353
354 sourceWithOffset(
355 prop: "start" | "end",

Callers 1

exactSourceMethod · 0.95

Calls 1

_normalizePositionMethod · 0.95

Tested by

no test coverage detected