aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/v4/typedarray.js
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-09-11 15:37:31 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-10-29 09:07:36 +0100
commita3a44fc16417edfe09fca757f4ab1fb8fdaff00d (patch)
treecce2b9d011b1e70736af2dab901247d9dcb2244e /tests/manual/v4/typedarray.js
parent868478e92afaa9d0823f3a65ff3d7b44216087ea (diff)
Basic support for typed arrays
This implements most of the spec required for the Khronos typed array specification. It tries to follow ECMAScript 6 as closely as possible, but currently only implements a subset of the ECMAScript 6 specification. Addes a test script in tests/manual/v4 to test our implementation. Change-Id: I8ec63869500358e088b73240e1f37120ae3cf59a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/manual/v4/typedarray.js')
-rw-r--r--tests/manual/v4/typedarray.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/manual/v4/typedarray.js b/tests/manual/v4/typedarray.js
new file mode 100644
index 0000000000..3a18531af8
--- /dev/null
+++ b/tests/manual/v4/typedarray.js
@@ -0,0 +1,13 @@
+var y = new Float32Array(3);
+y.set([1.3, 2.1, 3.5]);
+x = new Uint8ClampedArray(256);
+x.set([-3, 2.5, 3.5, 256]);
+x.set(y, 5);
+print(x.length, x.byteLength, x[0], x[1], x[2], x[3], x[5], x[6], x[7])
+x = new Int16Array(x);
+print(x.length, x.byteLength, x[0], x[1], x[2], x[3], x[5], x[6], x[7])
+x = x.subarray(1, 2);
+print(x)
+print(x.length, x.byteLength, x.byteOffset, x[0], x[1])//, x[2], x[3], x[5], x[6], x[7])
+x = new Int8Array([-1, 0, 3, 127, 255]);
+print(x.length, x.byteLength, x.byteOffset, x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7])