Skip to content

N-API: Support for DataView #13926

Closed
Closed
@mhdawson

Description

@mhdawson
  • Version: ALL
  • Platform: ALL
  • Subsystem: ALL

N-API currently has APIs for ArrayBuffer and TypedArray classes, but not the DataView class. The DataView class is specified by ES6 as another kind of view over an ArrayBuffer.

While it could be possible to extend (and rename?) napi_create_typedarray() and napi_get_typedarray_info() to also support DataView objects, The combination would be too confusing, because a DataView doesn't have a type, and measures length in terms of bytes instead of elements. There should be separate APIs:

  • napi_is_dataview()
  • napi_create_dataview()
  • napi_get_dataview_info()

The N-API team will get to this based on priorities, but this is a good place for others to contribute as well. If you start working on this, assign the issue to yourself and add a comment that you are working on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    node-apiIssues and PRs related to the Node-API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions