Skip to content

node::Buffer constructing in c++ addons #15517

@rimmartin

Description

@rimmartin

Hi, now that node::Buffer is a ArrayBufferView https://github.com/nodejs/node/blob/master/src/node_buffer.cc#L202 which covers all javascript typed arrays https://v8docs.nodesource.com/node-8.0/d5/dbb/classv8_1_1_typed_array.html, the Buffer::New's don't have a way to make Float64Array or any of the other typed arrays. For typed arrays passed from javascript the native code the type is known. Constructing a node::Buffer in the native code has no way to distinguish type on the javascript side.

Before it was one-to-one; UintArray to node::Buffer. Isn't there something like a node::Buffer::NewFloa64Array(...); needed for each type?

Version: dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    addonsIssues and PRs related to native addons.questionIssues that look for answers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions