The behavior of Buffer#compare doesn't match its documentation #17618
Labels
buffer
Issues and PRs related to the buffer subsystem.
doc
Issues and PRs related to the documentations.
good first issue
Issues that are suitable for first-time contributors.
In the documentation for Buffer#compare, it's stated that the
targetEnd
,sourceStart
, andsourceEnd
parameters are each "ignored whentargetStart
isundefined
". However, I do not observe that behavior on versions 6.12.2, 8.9.3, or 9.2.1. Instead, the following code fails the third assertion:Although both behaviors (ignoring or not ignoring subsequent parameters) seem reasonable, it looks like the discrepancy has always existed (see 473f086, which introduced the feature), so it probably makes more sense to change the docs.
The text was updated successfully, but these errors were encountered: