mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Add tests
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user