Repository navigation
Buffer.copyBytesFrom should accept a DataView as well. #47924
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on May 8, 2023 - addedbufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.
on May 9, 2023 I think I can help with this. I can modify the code to accomodate for dataView.
Relevant comments on why
DataViewwas not added earlier.To be frank at first glance, it looked manageable to me but it seems it's pretty complex.
Comments suggest that a separate method should be created for this. Would need maintainers' advice.
Reacted by Antoine du HamelRelevant comments on why
DataViewwas not added earlier.To be frank at first glance, it looked manageable to me but it seems it's pretty complex.
Comments suggest that a separate method should be created for this. Would need maintainers' advice.
@jasnell what do you think
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Nov 9, 2023 There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
For more information on how the project manages feature requests, please consult the feature request management document.
The issue
The
Buffer.copyBytesFrommethod was added by the issue #43862. What it does is create aBufferby copying the data to which the view of anArrayBufferorSharedArrayBufferis referring (“viewing”). The current problem is that it only accepts aTypedArrayfor itsviewparameter, whenDataViews, too, are views.My suggestion
I suggest:
Buffer.copyBytesFromto accept aDataViewas well for theviewparameter.