Skip to content
Snippets Groups Projects
Commit 4388f286 authored by Leonardo Balter's avatar Leonardo Balter Committed by Gorkem Yakin
Browse files

Allow call testWithTypedArrayConstructors with a constructors subset

parent 35dce20e
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ var typedArrayConstructors = [
Uint32Array,
Uint16Array,
Uint8Array,
Uint8ClampedArray,
Uint8ClampedArray
];
/**
......@@ -32,10 +32,12 @@ var TypedArray = Object.getPrototypeOf(Int8Array);
* Calls the provided function for every typed array constructor.
*
* @param {typedArrayConstructorCallback} f - the function to call for each typed array constructor.
* @param {Array} selected - An optional Array with filtered typed arrays
*/
function testWithTypedArrayConstructors(f) {
for (var i = 0; i < typedArrayConstructors.length; ++i) {
var constructor = typedArrayConstructors[i];
function testWithTypedArrayConstructors(f, selected) {
var constructors = selected || typedArrayConstructors;
for (var i = 0; i < constructors.length; ++i) {
var constructor = constructors[i];
try {
f(constructor);
} catch (e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment