-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.questionIssues that look for answers.Issues that look for answers.
Description
Hello!
ArrayBuffer.isView thinks of node buffers as views to ArrayBuffers. Is this correct behaviour?
var buffer = Buffer(0);
ArrayBuffer.isView(buffer); //true
Because this is a bit non-intuitive, as ArrayBuffer.isView()
is expected to detect TypedArrays, DataViews and stuff with ArrayBuffer as a .buffer
parameter (according to MDN). Indeed, buffer.buffer instanceof ArrayBuffer
— that is awesome (finding that out while writing this), but at least that needs to be covered by docs (?).
Also buffer.buffer
, which is ArrayBuffer, has byteLength very different from the Buffer.length. That is because of shared memory for Buffers, etc, but makes that inner ArrayBuffer useless, unfortunately.
Thank you for reading, just close if the issue is insubstantial IYO :)
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.questionIssues that look for answers.Issues that look for answers.