| typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; |
| let name = ["map", "reduce"]; |
| // First test with every access being neutered. |
| function test(constructor) { |
| let array = new constructor(10); |
| transferArrayBuffer(array.buffer); |
| for (let i = 0; i < 10000; i++) { |
| if (array.map !== constructor.prototype.map) |
| if (array[name[i % 2]] !== constructor.prototype[name[i % 2]]) |
| for (constructor of typedArrays) { |
| // Next test with neutered after tier up. |
| function test(constructor) { |
| let array = new constructor(10); |
| if (array.map !== constructor.prototype.map) |
| if (array[name[i % 2]] !== constructor.prototype[name[i % 2]]) |
| transferArrayBuffer(array.buffer); |