diff --git a/core/modules/color/preview.js b/core/modules/color/preview.js
index 9e1998515ce723cabf2cb2b31c86ad4b44564af9..828ed23475ad0606067d79a7ebc512f0aa9840b2 100644
--- a/core/modules/color/preview.js
+++ b/core/modules/color/preview.js
@@ -18,12 +18,12 @@
 
       // Set up gradients if there are some.
       var color_start, color_end;
-      for (i in settings.gradients) {
+      for (var i in settings.gradients) {
         color_start = farb.unpack(form.find('#palette input[name="palette[' + settings.gradients[i]['colors'][0] + ']"]').val());
         color_end = farb.unpack(form.find('#palette input[name="palette[' + settings.gradients[i]['colors'][1] + ']"]').val());
         if (color_start && color_end) {
           var delta = [];
-          for (j in color_start) {
+          for (var j in color_start) {
             delta[j] = (color_end[j] - color_start[j]) / (settings.gradients[i]['vertical'] ? height[i] : width[i]);
           }
           var accum = color_start;
diff --git a/core/modules/openid/openid.js b/core/modules/openid/openid.js
index 53a0cb3d58816deca1c57fb478c006f787a87fb3..c138ebb24b48eef78270d7e81495e9a1ba58f900 100644
--- a/core/modules/openid/openid.js
+++ b/core/modules/openid/openid.js
@@ -11,7 +11,7 @@ Drupal.behaviors.openid = {
 
     // This behavior attaches by ID, so is only valid once on a page.
     if (cookie || location.hash == '#openid-login') {
-      $edit_openid_identifier = $('#edit-openid-identifier');
+      var $edit_openid_identifier = $('#edit-openid-identifier');
       if (cookie) {
         $edit_openid_identifier.val(cookie);
       }