MCPcopy
hub / github.com/rollup/rollup / addLocationToLogProps

Method addLocationToLogProps

src/Module.ts:1202–1220  ·  view source on GitHub ↗
(properties: RollupLog, pos: number)

Source from the content-addressed store, hash-verified

1200 }
1201
1202 private addLocationToLogProps(properties: RollupLog, pos: number): void {
1203 properties.id = this.id;
1204 properties.pos = pos;
1205 let code = this.info.code;
1206 const location = locate(code!, pos, { offsetLine: 1 });
1207 if (location) {
1208 let { column, line } = location;
1209 try {
1210 ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line }));
1211 code = this.originalCode;
1212 } catch (error_: any) {
1213 this.options.onLog(
1214 LOGLEVEL_WARN,
1215 logInvalidSourcemapForError(error_, this.id, column, line, pos)
1216 );
1217 }
1218 augmentCodeLocation(properties, { column, line }, code!, this.id);
1219 }
1220 }
1221
1222 private addModulesToImportDescriptions(
1223 importDescription: ReadonlyMap<string, ImportDescription | ReexportDescription>

Callers 2

errorMethod · 0.95
logMethod · 0.95

Calls 3

getOriginalLocationFunction · 0.90
augmentCodeLocationFunction · 0.90

Tested by

no test coverage detected