diff --git a/src/v8/V8CodeCacheParser.ts b/src/v8/V8CodeCacheParser.ts index 6d79d516434..87d144f064a 100644 --- a/src/v8/V8CodeCacheParser.ts +++ b/src/v8/V8CodeCacheParser.ts @@ -203,7 +203,6 @@ class V8CodeCachePayloadScanner { readonly #maxStrings: number; #cursor = 0; #runStart = -1; - #runLength = 0; // not-an-allowance: fixed scratch buffer write length capped at MAX_INSPECT_V8_CODE_CACHE_STRING_BYTES #retainedLength = 0; @@ -215,7 +214,7 @@ class V8CodeCachePayloadScanner { #flush(): void { if (this.#runStart < 0) return; - const runBytes = this.#runLength; + const runBytes = this.#cursor - this.#runStart; if (runBytes >= this.#minStringBytes) { if (this.#observations.length >= this.#maxStrings) // The message states the fact. Recovery advice belongs to the provider, which @@ -235,7 +234,6 @@ class V8CodeCachePayloadScanner { }); } this.#runStart = -1; - this.#runLength = 0; this.#retainedLength = 0; } @@ -251,7 +249,6 @@ class V8CodeCachePayloadScanner { this.#runBuffer[this.#retainedLength] = byte; this.#retainedLength += 1; } - this.#runLength += 1; } else { this.#flush(); }