Skip to content

fix(node:buffer): honor compare range args#2288

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-buffer-compare-range-args
May 28, 2026
Merged

fix(node:buffer): honor compare range args#2288
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-buffer-compare-range-args

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Part of #793.

Summary

  • route buf.compare(target, targetStart?, targetEnd?, sourceStart?, sourceEnd?) through the range-aware helper whenever range args are supplied
  • apply Node defaults for omitted/undefined bounds: targetStart=0, targetEnd=target.length, sourceStart=0, sourceEnd=this.length
  • preserves the one-argument full-buffer compare path

Verification

Non-goals

  • no compare target type validation
  • no exact error message text cleanup
  • no range-error output cleanup beyond this optional-argument path
  • no Buffer.from/write/fill coercion work

@proggeramlug proggeramlug merged commit 9afabaf into PerryTS:main May 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants