MCPcopy Index your code
hub / github.com/nodejs/node / _processChunk

Method _processChunk

deps/v8/tools/system-analyzer/processor.mjs:233–261  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

231 }
232
233 async _processChunk(chunk) {
234 const prevProcessedInputChars = this._processedInputChars;
235 let end = chunk.length;
236 let current = 0;
237 let next = 0;
238 let line;
239 try {
240 while (current < end) {
241 next = chunk.indexOf('\n', current);
242 if (next === -1) {
243 this._chunkRemainder += chunk.substring(current);
244 break;
245 }
246 line = chunk.substring(current, next);
247 if (this._chunkRemainder) {
248 line = this._chunkRemainder + line;
249 this._chunkRemainder = '';
250 }
251 current = next + 1;
252 this._lineNumber++;
253 await this.processLogLine(line);
254 this._processedInputChars = prevProcessedInputChars + current;
255 }
256 this._updateProgress();
257 } catch (e) {
258 console.error(`Could not parse log line ${
259 this._lineNumber}, trying to continue: ${e}`);
260 }
261 }
262
263 async processLogFile(fileName) {
264 this.collectEntries = true;

Callers 2

constructorMethod · 0.95

Calls 4

_updateProgressMethod · 0.95
processLogLineMethod · 0.80
indexOfMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected