From 0bb99c820c1b6302ed9d4c389be9c42caa0145f9 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Fri, 23 Nov 2012 21:40:39 -0500 Subject: [PATCH] Closurify some low-hanging fruit --- closure-todo.txt | 22 ++++++++++++++++++++++ dashed-canvas.js | 3 ++- dygraph-options-reference.js | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 closure-todo.txt 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', -- 2.7.4