shell.js (1177B)
1 // GENERATED, DO NOT EDIT 2 // file: testBigIntTypedArray.js 3 // Copyright (C) 2015 André Bargull. All rights reserved. 4 // This code is governed by the BSD license found in the LICENSE file. 5 /*--- 6 description: | 7 Collection of functions used to assert the correctness of BigInt TypedArray objects. 8 defines: 9 - TypedArray 10 - testWithBigIntTypedArrayConstructors 11 ---*/ 12 13 /** 14 * The %TypedArray% intrinsic constructor function. 15 */ 16 var TypedArray = Object.getPrototypeOf(Int8Array); 17 18 /** 19 * Calls the provided function for every typed array constructor. 20 * 21 * @param {typedArrayConstructorCallback} f - the function to call for each typed array constructor. 22 * @param {Array} selected - An optional Array with filtered typed arrays 23 */ 24 function testWithBigIntTypedArrayConstructors(f, selected) { 25 /** 26 * Array containing every BigInt typed array constructor. 27 */ 28 var constructors = selected || [ 29 BigInt64Array, 30 BigUint64Array 31 ]; 32 33 for (var i = 0; i < constructors.length; ++i) { 34 var constructor = constructors[i]; 35 try { 36 f(constructor); 37 } catch (e) { 38 e.message += " (Testing with " + constructor.name + ".)"; 39 throw e; 40 } 41 } 42 }