fix(node:buffer): handle Buffer.from object sources#2298
Merged
proggeramlug merged 2 commits intoMay 28, 2026
Merged
Conversation
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.
Part of #793.
Summary:
Buffer.frombefore theArrayHeaderfallbacklength, return empty for non-number/non-positive lengths, and truncate fractional lengthsvalueOf()string/object results and string-returningSymbol.toPrimitivesourcesVerification:
reference/deepwiki/nodejs-node-buffer-from-arraylike-coercions-2026-05-28.mdreference/deepwiki/nodejs-node-buffer-from-object-primitives-2026-05-28.mdnode-suite/buffer/from/arraylike-coercions: FAIL, reporttest-parity/reports/parity_report_20260528_125501.jsonnode-suite/buffer/from/arraylike-coercions: PASS, reporttest-parity/reports/parity_report_20260528_125818.jsonnode-suite/buffer/from/valueof-symbol-to-primitive: FAIL, reporttest-parity/reports/parity_report_20260528_130501.jsonnode-suite/buffer/from/valueof-symbol-to-primitive: PASS, reporttest-parity/reports/parity_report_20260528_130903.jsonnode-suite/buffer/from: 15 PASS / 1 parity FAIL, reporttest-parity/reports/parity_report_20260528_130955.json; only primitive input validation remains red and is covered by fix(node:buffer): reject primitive from inputs #2287node-suite/buffer: 105 PASS / 10 parity FAIL / 1 compile FAIL, reporttest-parity/reports/parity_report_20260528_131022.json; targets greencargo check -p perry-runtime -p perry-stdlib -p perry-codegen: PASS with existing warningscargo fmt --check: PASSjq empty test-parity/known_failures.json: PASSgit diff --check: PASSNon-goals:
Symbol.toPrimitiveTypeError cleanup