Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable all typed array function #29

Merged
merged 1 commit into from Feb 19, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 6 additions & 12 deletions js/src/jsfriendapi.h
Expand Up @@ -1054,19 +1054,14 @@ typedef uint32_t JSArrayBufferViewType;
/*
* Create a new typed array with nelements elements.
*/
JS_BEGIN_EXTERN_C

extern JS_FRIEND_API(JSObject *)
JS_NewInt8Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewUint8Array(JSContext *cx, uint32_t nelements);

JS_BEGIN_EXTERN_C

extern JS_FRIEND_API(JSObject *)
JS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements);

JS_END_EXTERN_C

extern JS_FRIEND_API(JSObject *)
JS_NewInt16Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
Expand All @@ -1080,6 +1075,8 @@ JS_NewFloat32Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewFloat64Array(JSContext *cx, uint32_t nelements);

JS_END_EXTERN_C

/*
* Create a new typed array and copy in values from the given object. The
* object is used as if it were an array; that is, the new array (if
Expand Down Expand Up @@ -1320,19 +1317,14 @@ JS_GetArrayBufferViewByteLength(JSObject *obj, JSContext *cx);
* unwrapping will succeed. If cx is NULL, then DEBUG builds may be unable to
* assert when unwrapping should be disallowed.
*/
JS_BEGIN_EXTERN_C

extern JS_FRIEND_API(int8_t *)
JS_GetInt8ArrayData(JSObject *obj, JSContext *cx);
extern JS_FRIEND_API(uint8_t *)
JS_GetUint8ArrayData(JSObject *obj, JSContext *cx);

JS_BEGIN_EXTERN_C

extern JS_FRIEND_API(uint8_t *)
JS_GetUint8ClampedArrayData(JSObject *obj, JSContext *cx);

JS_END_EXTERN_C

extern JS_FRIEND_API(int16_t *)
JS_GetInt16ArrayData(JSObject *obj, JSContext *cx);
extern JS_FRIEND_API(uint16_t *)
Expand All @@ -1346,6 +1338,8 @@ JS_GetFloat32ArrayData(JSObject *obj, JSContext *cx);
extern JS_FRIEND_API(double *)
JS_GetFloat64ArrayData(JSObject *obj, JSContext *cx);

JS_END_EXTERN_C

/*
* Same as above, but for any kind of ArrayBufferView. Prefer the type-specific
* versions when possible.
Expand Down