3 <script src=
"../../../resources/js-test.js"></script>
4 <script src=
"resources/webgl-test.js"></script>
7 <div id=
"description"></div>
8 <div id=
"console"></div>
12 description("Verifies that attempting to set invalid elements to a Typed Array throws an exception");
14 // Global scope so shouldThrow can see it
15 var typedArray
, otherArray
;
17 function negativeTestSet(typeName
) {
18 var type
= window
[typeName
];
19 typedArray
= new type(10);
21 shouldThrow("typedArray.set()");
22 shouldThrow("typedArray.set('hello world')");
24 otherArray
= new type(typedArray
.length
);
25 shouldThrow("typedArray.set(otherArray, 1)");
28 negativeTestSet("Int8Array");
29 negativeTestSet("Uint8Array");
30 negativeTestSet("Int16Array");
31 negativeTestSet("Uint16Array");
32 negativeTestSet("Int32Array");
33 negativeTestSet("Uint32Array");
34 negativeTestSet("Float32Array");