← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:eslint-views-global into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:eslint-views-global into launchpad:master.

Commit message:
eslint: Fix guard-for-in and no-global-assign in global.js

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/407004

`Y.Array.each` is simpler anyway.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:eslint-views-global into launchpad:master.
diff --git a/lib/lp/app/javascript/views/global.js b/lib/lp/app/javascript/views/global.js
index 0f9f24c..be3eea9 100644
--- a/lib/lp/app/javascript/views/global.js
+++ b/lib/lp/app/javascript/views/global.js
@@ -85,11 +85,9 @@ YUI.add('lp.views.global', function (Y) {
          * @private
          */
         _destroy: function (ev) {
-            var index;
-            for (index in this._events) {
-                event = this._events[index];
-                event.detach();
-            }
+            Y.Array.each(this._events, function(binding) {
+                binding.detach();
+            });
         },
 
         _init_banners: function () {