From: Dan Vanderkam Date: Sat, 24 Nov 2012 02:40:39 +0000 (-0500) Subject: Closurify some low-hanging fruit X-Git-Tag: v1.0.0~165 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=0bb99c820c1b6302ed9d4c389be9c42caa0145f9;p=dygraphs.git Closurify some low-hanging fruit --- diff --git a/closure-todo.txt b/closure-todo.txt new file mode 100644 index 0000000..8244196 --- /dev/null +++ b/closure-todo.txt @@ -0,0 +1,22 @@ +Core: +- dygraph-canvas.js +- dygraph-gviz.js +- dygraph-interaction-model.js +- dygraph-layout.js +- dygraph-options.js +- dygraph-range-selector.js +- dygraph-tickers.js +- dygraph.js +x dygraph-options-reference.js +x dygraph-utils.js +x dashed-canvas.js + +Plugins: +- plugins/annotations.js +- plugins/axes.js +- plugins/base.js +- plugins/chart-labels.js +- plugins/grid.js +- plugins/install.js +- plugins/legend.js + diff --git a/dashed-canvas.js b/dashed-canvas.js index 853d67b..cec7729 100644 --- a/dashed-canvas.js +++ b/dashed-canvas.js @@ -40,7 +40,7 @@ * property and "uninstallPattern" method to this particular canvas context. * You must call uninstallPattern() before calling installPattern() again. * - * @param {pattern | Array} A description of the stroke pattern. Even + * @param {Array.} pattern A description of the stroke pattern. Even * indices indicate a draw and odd indices indicate a gap (in pixels). The * array should have a even length as any odd lengthed array could be expressed * as a smaller even length array. @@ -65,6 +65,7 @@ CanvasRenderingContext2D.prototype.installPattern = function(pattern) { var realMoveTo = this.moveTo; var realStroke = this.stroke; + /** @type {function()|undefined} */ this.uninstallPattern = function() { this.beginPath = realBeginPath; this.lineTo = realLineTo; diff --git a/dygraph-options-reference.js b/dygraph-options-reference.js index abdb015..5aa7f05 100644 --- a/dygraph-options-reference.js +++ b/dygraph-options-reference.js @@ -770,7 +770,7 @@ Dygraph.OPTIONS_REFERENCE = // // Do a quick sanity check on the options reference. (function() { "use strict"; - var warn = function(msg) { if (console) console.warn(msg); }; + var warn = function(msg) { if (window.console) window.console.warn(msg); }; var flds = ['type', 'default', 'description']; var valid_cats = [ 'Annotations',