From: Dan Vanderkam <danvk@google.com>
Date: Mon, 19 Dec 2011 21:40:46 +0000 (-0500)
Subject: Fix another missing "var" and put rgbcolor.js into strict mode.
X-Git-Tag: v1.0.0~402
X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=3856711fdbd07233a7c59c3d83d86cc7fc4f3435;p=dygraphs.git

Fix another missing "var" and put rgbcolor.js into strict mode.
---

diff --git a/rgbcolor/rgbcolor.js b/rgbcolor/rgbcolor.js
index b8b29d7..67b730e 100644
--- a/rgbcolor/rgbcolor.js
+++ b/rgbcolor/rgbcolor.js
@@ -2,12 +2,14 @@
  * A class to parse color values
  *
  * NOTE: modified by danvk. I removed the "getHelpXML" function to reduce the
- * file size.
+ * file size, added "use strict" and a few "var" declarations where needed.
  *
  * @author Stoyan Stefanov <sstoo@gmail.com>
  * @link   http://www.phpied.com/rgb-color-parser-in-javascript/
  * @license Use it if you like it
  */
+"use strict";
+
 function RGBColor(color_string)
 {
     this.ok = false;
@@ -217,7 +219,7 @@ function RGBColor(color_string)
         var processor = color_defs[i].process;
         var bits = re.exec(color_string);
         if (bits) {
-            channels = processor(bits);
+            var channels = processor(bits);
             this.r = channels[0];
             this.g = channels[1];
             this.b = channels[2];