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

Function resetStartLocation

packages/babel-parser/src/parser/node.ts:142–149  ·  view source on GitHub ↗
(node: BaseNode, startLoc: Position)

Source from the content-addressed store, hash-verified

140 }
141
142 resetStartLocation(node: BaseNode, startLoc: Position): void {
143 node.start = startLoc.index;
144 const { optionFlags } = this;
145 if (optionFlags & OptionFlags.Locations) {
146 node.loc!.start = this.createPosition(startLoc);
147 }
148 if (optionFlags & OptionFlags.Ranges) node.range![0] = startLoc.index;
149 }
150
151 resetEndLocation(
152 node: BaseNode,

Callers

nothing calls this directly

Calls 1

createPositionMethod · 0.80

Tested by

no test coverage detected