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

Function resetStartLocationFromNode

packages/babel-parser/src/parser/node.ts:166–173  ·  view source on GitHub ↗

* Reset the start location of node to the start location of locationNode

(node: BaseNode, locationNode: BaseNode)

Source from the content-addressed store, hash-verified

164 * Reset the start location of node to the start location of locationNode
165 */
166 resetStartLocationFromNode(node: BaseNode, locationNode: BaseNode): void {
167 node.start = locationNode.start;
168 const { optionFlags } = this;
169 if (optionFlags & OptionFlags.Locations) {
170 node.loc!.start = locationNode.loc!.start;
171 }
172 if (optionFlags & OptionFlags.Ranges) node.range![0] = locationNode.start!;
173 }
174
175 resetEndLocationFromNode(node: BaseNode, locationNode: BaseNode): void {
176 node.end = locationNode.end;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected