Skip to content

N-API: Support for DataView #13926

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.

Activity

  1. shivanth commented on Jun 30, 2017

    @shivanth
    Contributor

    I'm working on this

  2. cjihrig commented on Jul 14, 2017

    @cjihrig
    Contributor

    @shivanth are you still working on this?

  3. shivanth commented on Jul 14, 2017

    @shivanth
    Contributor

    Yup

  4. shivanth commented on Jul 14, 2017

    @shivanth
    Contributor

    I might be able to submit a PR this weekend

  5. added a commit that references this issue on Jul 19, 2017
  6. added a commit that references this issue on Jul 27, 2017
  7. added a commit that references this issue on Apr 16, 2018
  8. added a commit that references this issue on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    node-apiIssues and PRs related to Node-API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions