From c3b22324f1013d136caba187584e6fac3cf83b1a Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Tue, 28 Apr 2015 12:30:15 +0200 Subject: [PATCH 1/3] uses clamped array for values --- lib/torque/provider/windshaft.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 3309b2cfad27226099e6ac6f7eb351fbbc944c85 Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Tue, 28 Apr 2015 12:28:23 +0200 Subject: [PATCH 2/3] adds clamped type --- lib/torque/core.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/torque/core.js b/lib/torque/core.js index 6aebbe7..ea25891 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 From a27960fbe7c701a64174f7e128fd3ba0259fb945 Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Tue, 28 Apr 2015 12:43:46 +0200 Subject: [PATCH 3/3] adds stupid comma --- lib/torque/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/torque/core.js b/lib/torque/core.js index ea25891..8dbc481 100644 --- a/lib/torque/core.js +++ b/lib/torque/core.js @@ -61,7 +61,7 @@ // types var types = { Uint8Array: typeof(global['Uint8Array']) !== 'undefined' ? global.Uint8Array : Array, - Uint8ClampedArray: typeof(global['Uint8ClampedArray']) !== 'undefined' ? global.Uint8ClampedArray: 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