Repository navigation
Conversation
wdavidw
reviewed
Oct 11, 2026
| let data; | ||
| try { | ||
| callback(undefined, chunks.join("")); | ||
| data = chunks.join(""); |
Member
There was a problem hiding this comment.
data = chunks.join(""); will never throw an error, try/catch is not used
| @@ -1,4 +1,6 @@ | |||
| import "should"; | |||
| import assert from "node:assert/strict"; | |||
Member
There was a problem hiding this comment.
We are not using assert, only should.js
| @@ -1,4 +1,6 @@ | |||
| import "should"; | |||
| import assert from "node:assert/strict"; | |||
| import { spawnSync } from "node:child_process"; | |||
Member
There was a problem hiding this comment.
I don't think that spaning a new process is necessary to illustrate this issue.
| @@ -1,4 +1,6 @@ | |||
| import "should"; | |||
| import assert from "node:assert/strict"; | |||
| import { spawnSync } from "node:child_process"; | |||
Member
There was a problem hiding this comment.
I don't think that spaning a new process is necessary to illustrate this issue.
Also, using a sync api (spawnSync here) is not appropriate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a successful stringify callback throws, the end handler catches the caller's exception and invokes that callback again with the error.
Limit the catch to collecting the output, then invoke the callback outside it. Oversized-output errors retain their existing callback handling.
Add one subprocess regression checking that the callback runs once and its original exception escapes. It fails before the fix and passes afterward.
Validation on Node.js 22.22.0:
2 !== 1callback invocations.git diff --check: passes.