aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/v4/typedarray.js
diff options
context:
space:
mode:
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])