From: Dan Vanderkam Date: Tue, 31 Jul 2012 21:30:18 +0000 (-0400) Subject: declare vars in dashed-canvas X-Git-Tag: v1.0.0~206 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=ddc5f0ee53bd5579b1bbd228ce8ce80a2f5d237c;p=dygraphs.git declare vars in dashed-canvas --- diff --git a/dashed-canvas.js b/dashed-canvas.js index d8ebac0..853d67b 100644 --- a/dashed-canvas.js +++ b/dashed-canvas.js @@ -46,6 +46,8 @@ * as a smaller even length array. */ CanvasRenderingContext2D.prototype.installPattern = function(pattern) { + "use strict"; + if (typeof(this.isPatternInstalled) !== 'undefined') { throw "Must un-install old line pattern before installing a new one."; } @@ -115,10 +117,10 @@ CanvasRenderingContext2D.prototype.installPattern = function(pattern) { // Set last pattern index we used for this pattern. var patternIndex = dashedLineToHistory[0]; - x = 0; + var x = 0; while (len > x) { // Get the length of the pattern segment we are dealing with. - segment = pattern[patternIndex]; + var segment = pattern[patternIndex]; // If our last draw didn't complete the pattern segment all the way // we will try to finish it. Otherwise we will try to do the whole // segment.