X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dashed-canvas.js;h=0fc687450ac4b65cc778cd336b2f0eb701c76b78;hb=daab85060912edf8b14c7315a40b3cbe9e923c07;hp=c92a3224bf5fb01e6d35b15ef8ef0e3ba4153275;hpb=46fd90891e949491786930cd562992417efe9614;p=dygraphs.git diff --git a/dashed-canvas.js b/dashed-canvas.js index c92a322..0fc6874 100644 --- a/dashed-canvas.js +++ b/dashed-canvas.js @@ -4,6 +4,9 @@ * MIT-licensed (http://opensource.org/licenses/MIT) */ +(function() { +'use strict'; + /** * @fileoverview Adds support for dashed lines to the HTML5 canvas. * @@ -46,8 +49,6 @@ * 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."; } @@ -175,3 +176,5 @@ CanvasRenderingContext2D.prototype.uninstallPattern = function() { // This will be replaced by a non-error version when a pattern is installed. throw "Must install a line pattern before uninstalling it."; }; + +})();