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

Function resetEndLocation

packages/babel-parser/src/parser/node.ts:151–161  ·  view source on GitHub ↗
(
    node: BaseNode,
    endLoc: Position = this.state.lastTokEndLoc!,
  )

Source from the content-addressed store, hash-verified

149 }
150
151 resetEndLocation(
152 node: BaseNode,
153 endLoc: Position = this.state.lastTokEndLoc!,
154 ): void {
155 node.end = endLoc.index;
156 const { optionFlags } = this;
157 if (optionFlags & OptionFlags.Locations) {
158 node.loc!.end = this.createPosition(endLoc);
159 }
160 if (optionFlags & OptionFlags.Ranges) node.range![1] = endLoc.index;
161 }
162
163 /**
164 * Reset the start location of node to the start location of locationNode

Callers

nothing calls this directly

Calls 1

createPositionMethod · 0.80

Tested by

no test coverage detected