child_process: fix primordials usage in stderr truncation - #64804
Open
Rauneet-coder wants to merge 1 commit into
Open
child_process: fix primordials usage in stderr truncation#64804Rauneet-coder wants to merge 1 commit into
Rauneet-coder wants to merge 1 commit into
Conversation
In `execFile()`, the stderr `data` event handler was calling `chunk.slice(0, truncatedLen)` directly on the chunk object. This was inconsistent with stdout handling, which uses a safe local `slice` helper with `StringPrototypeSlice` for strings and a function wrapper for buffers. This change updates the stderr handler to use the same `slice` helper, ensuring consistent primordials usage across both stdout and stderr stream truncation. Signed-off-by: Rauneet Singh <[email protected]>
Member
|
How does this benefit node core? |
Author
|
The primary goal was to make the stderr truncation path consistent with the existing stdout implementation, which already uses the local slice helper. My intention was to reduce divergence between two equivalent code paths rather than introduce any behavioral change. |
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.
Fixes #
Summary
Reuse the existing
slicehelper forstderrtruncation inchild_process.execFile().The
stdouttruncation path already uses the localslicehelper, while thestderrpath callschunk.slice()directly. This change makes both paths consistent by reusing the same helper without changing behavior.Testing
child_processtests.stdoutandstderrtruncation behavior remains unchanged.Proposed changelog entries
N/A
Proposed changelog category
/label skip-changelog
Proposed upgrade guidelines
N/A