Add tests

This commit is contained in:
xl1 2018-09-15 23:02:36 +09:00
parent 9819b6b7aa
commit 89e7d51df4

View file

@ -105,6 +105,21 @@ function CreateTypedArraysOf2() {
return typedArrays;
}
function CreateTypedArraysFromMapFn2<T>(obj:ArrayLike<T>, mapFn: (n:T, v:number)=> number) {
var typedArrays = [];
typedArrays[0] = Int8Array.from(obj, mapFn);
typedArrays[1] = Uint8Array.from(obj, mapFn);
typedArrays[2] = Int16Array.from(obj, mapFn);
typedArrays[3] = Uint16Array.from(obj, mapFn);
typedArrays[4] = Int32Array.from(obj, mapFn);
typedArrays[5] = Uint32Array.from(obj, mapFn);
typedArrays[6] = Float32Array.from(obj, mapFn);
typedArrays[7] = Float64Array.from(obj, mapFn);
typedArrays[8] = Uint8ClampedArray.from(obj, mapFn);
return typedArrays;
}
function CreateTypedArraysFromMapFn(obj:ArrayLike<number>, mapFn: (n:number, v:number)=> number) {
var typedArrays = [];
typedArrays[0] = Int8Array.from(obj, mapFn);
@ -132,5 +147,20 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike<number>, mapFn: (n:number, v
typedArrays[7] = Float64Array.from(obj, mapFn, thisArg);
typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg);
return typedArrays;
}
function CreateTypedArraysFromThisObj2<T>(obj:ArrayLike<T>, mapFn: (n:T, v:number)=> number, thisArg: {}) {
var typedArrays = [];
typedArrays[0] = Int8Array.from(obj, mapFn, thisArg);
typedArrays[1] = Uint8Array.from(obj, mapFn, thisArg);
typedArrays[2] = Int16Array.from(obj, mapFn, thisArg);
typedArrays[3] = Uint16Array.from(obj, mapFn, thisArg);
typedArrays[4] = Int32Array.from(obj, mapFn, thisArg);
typedArrays[5] = Uint32Array.from(obj, mapFn, thisArg);
typedArrays[6] = Float32Array.from(obj, mapFn, thisArg);
typedArrays[7] = Float64Array.from(obj, mapFn, thisArg);
typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg);
return typedArrays;
}