diff --git a/lib/torque/core.js b/lib/torque/core.js index 6aebbe7..8dbc481 100644 --- a/lib/torque/core.js +++ b/lib/torque/core.js @@ -61,6 +61,7 @@ // types var types = { Uint8Array: typeof(global['Uint8Array']) !== 'undefined' ? global.Uint8Array : Array, + Uint8ClampedArray: typeof(global['Uint8ClampedArray']) !== 'undefined' ? global.Uint8ClampedArray: Array, Uint32Array: typeof(global['Uint32Array']) !== 'undefined' ? global.Uint32Array : Array, Int16Array: typeof(global['Int16Array']) !== 'undefined' ? global.Int16Array : Array, Int32Array: typeof(global['Int32Array']) !== 'undefined' ? global.Int32Array: Array diff --git a/lib/torque/provider/windshaft.js b/lib/torque/provider/windshaft.js index 3b21fdc..5aed40a 100644 --- a/lib/torque/provider/windshaft.js +++ b/lib/torque/provider/windshaft.js @@ -4,6 +4,7 @@ var Uint8Array = torque.types.Uint8Array; var Int32Array = torque.types.Int32Array; var Uint32Array = torque.types.Uint32Array; + var Uint8ClampedArray = torque.types.Uint8ClampedArray; // format('hello, {0}', 'rambo') -> "hello, rambo" function format(str) { @@ -82,7 +83,7 @@ dates = (1 + maxDateSlots) * rows.length; } - var type = this.options.cumulative ? Uint32Array: Uint8Array; + var type = this.options.cumulative ? Uint32Array: Uint8ClampedArray; // reserve memory for all the dates var timeIndex = new Int32Array(maxDateSlots + 1); //index-size