You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/jswrap_arraybuffer.c
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@ This is the built-in JavaScript class that is the prototype for:
40
40
* [Int8Array](/Reference#Int8Array)
41
41
* [Uint16Array](/Reference#Uint16Array)
42
42
* [Int16Array](/Reference#Int16Array)
43
+
* [Uint24Array](/Reference#Uint24Array) (Espruino-specific - not standard JS)
43
44
* [Uint32Array](/Reference#Uint32Array)
44
45
* [Int32Array](/Reference#Int32Array)
45
46
* [Float32Array](/Reference#Float32Array)
@@ -112,6 +113,20 @@ This is the built-in JavaScript class for a typed array of 16 bit signed integer
112
113
113
114
Instantiate this in order to efficiently store arrays of data (Espruino's normal arrays store data in a map, which is inefficient for non-sparse arrays).
114
115
116
+
Arrays of this type include all the methods from [ArrayBufferView](/Reference#ArrayBufferView)
"not_real_object" : "Don't treat this as a real object - it's handled differently internally"
125
+
}
126
+
This is the built-in JavaScript class for a typed array of 24 bit unsigned integers.
127
+
128
+
Instantiate this in order to efficiently store arrays of data (Espruino's normal arrays store data in a map, which is inefficient for non-sparse arrays).
129
+
115
130
Arrays of this type include all the methods from [ArrayBufferView](/Reference#ArrayBufferView)
116
131
*/
117
132
/*JSON{
@@ -298,12 +313,28 @@ Create a typed array based on the given input. Either an existing Array Buffer,
298
313
"return" : ["JsVar","A typed array"],
299
314
"return_object" : "ArrayBufferView"
300
315
}
316
+
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an ArrayBuffer view (eg. Uint8Array rather than ArrayBuffer) is given, it will be completely copied rather than referenced.
["arr","JsVar","The array or typed array to base this off, or an integer which is the array length"],
325
+
["byteOffset","int","The byte offset in the ArrayBuffer (ONLY IF the first argument was an ArrayBuffer)"],
326
+
["length","int","The length (ONLY IF the first argument was an ArrayBuffer)"]
327
+
],
328
+
"return" : ["JsVar","A typed array"],
329
+
"return_object" : "ArrayBufferView"
330
+
}
301
331
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an ArrayBuffer view (eg. Uint8Array rather than ArrayBuffer) is given, it will be completely copied rather than referenced.
0 commit comments