MCPcopy Create free account
hub / github.com/nodejs/node / setSources

Method setSources

deps/v8/tools/turbolizer/src/source-resolver.ts:84–96  ·  view source on GitHub ↗
(sourcesJson, mainFunc: Source)

Source from the content-addressed store, hash-verified

82 }
83
84 public setSources(sourcesJson, mainFunc: Source): void {
85 if (sourcesJson) {
86 for (const [sourceId, source] of Object.entries<Source>(sourcesJson)) {
87 const src = new Source(source.sourceName, source.functionName, source.sourceText,
88 source.sourceId, source.backwardsCompatibility, source.startPosition, source.endPosition);
89 this.sources[sourceId] = src;
90 }
91 }
92 // This is a fallback if the JSON is incomplete (e.g. due to compiler crash).
93 if (!this.sources[-1]) {
94 this.sources[-1] = mainFunc;
95 }
96 }
97
98 public setBytecodeSources(bytecodeSourcesJson): void {
99 if (!bytecodeSourcesJson) return;

Callers 1

loadFileFunction · 0.80

Calls 1

entriesMethod · 0.45

Tested by

no test coverage detected