- 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.
N-API currently has APIs for
ArrayBufferandTypedArrayclasses, but not theDataViewclass. TheDataViewclass is specified by ES6 as another kind of view over anArrayBuffer.While it could be possible to extend (and rename?)
napi_create_typedarray()andnapi_get_typedarray_info()to also supportDataViewobjects, The combination would be too confusing, because aDataViewdoesn'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.