Closurify some low-hanging fruit
authorDan Vanderkam <dan@dygraphs.com>
Sat, 24 Nov 2012 02:40:39 +0000 (21:40 -0500)
committerDan Vanderkam <dan@dygraphs.com>
Sat, 24 Nov 2012 02:40:39 +0000 (21:40 -0500)
closure-todo.txt [new file with mode: 0644]
dashed-canvas.js
dygraph-options-reference.js

diff --git a/closure-todo.txt b/closure-todo.txt
new file mode 100644 (file)
index 0000000..8244196
--- /dev/null
@@ -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
+
index 853d67b..cec7729 100644 (file)
@@ -40,7 +40,7 @@
  * property and "uninstallPattern" method to this particular canvas context.
  * You must call uninstallPattern() before calling installPattern() again.
  *
- * @param {pattern | Array<Number>} A description of the stroke pattern. Even
+ * @param {Array.<number>} 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;
index abdb015..5aa7f05 100644 (file)
@@ -770,7 +770,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
 // 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',