Fix bug 428, add test which catches exception. What an annoying little bug.
[dygraphs.git] / plugins / annotations.js
index 796d6c3..6a24894 100644 (file)
@@ -4,6 +4,8 @@
  * MIT-licensed (http://opensource.org/licenses/MIT)
  */
 
+/*global Dygraph:false */
+
 Dygraph.Plugins.Annotations = (function() {
 
 "use strict";
@@ -54,7 +56,7 @@ annotations.prototype.didDrawChart = function(e) {
 
   // Early out in the (common) case of zero annotations.
   var points = g.layout_.annotated_points;
-  if (!points || points.length == 0) return;
+  if (!points || points.length === 0) return;
 
   var containerDiv = e.canvas.parentNode;
   var annotationStyle = {