Skip to content

APIs for ES6 DataView #202

Closed
Closed
@jasongin

Description

@jasongin

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, I think the combination would be too confusing, because a DataView doesn't have a type, and measures length in terms of bytes instead of elements. So, probably there should be separate APIs:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions