From fb2c6c0eb8d0eda08ab50b37d659eb1a3320c1b0 Mon Sep 17 00:00:00 2001 From: Serge Gautherie Date: Fri, 7 Aug 2009 19:26:23 +0200 Subject: [PATCH] Bug 507421 - Port |Bug 418490 - Implement iterator-helper module for dealing with xpcom arrays in javascript| to SM; (Av1) commandglue.js (only); r=iann_bugzilla --- suite/mailnews/commandglue.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/suite/mailnews/commandglue.js b/suite/mailnews/commandglue.js index 608d7f5f63..8c1cf73163 100644 --- a/suite/mailnews/commandglue.js +++ b/suite/mailnews/commandglue.js @@ -44,6 +44,8 @@ * Command-specific code. This stuff should be called by the widgets */ +Components.utils.import("resource://gre/modules/iteratorUtils.jsm"); + //NOTE: gMessengerBundle and gBrandBundle must be defined and set // for this Overlay to work properly @@ -1075,8 +1077,10 @@ function setupXFVirtualFolderSearch(folderUrisToSearch, searchTerms, searchOnlin } var termsArray = searchTerms.QueryInterface(Components.interfaces.nsISupportsArray); - for (i = 0; i < termsArray.Count(); ++i) - gSearchSession.appendTerm(termsArray.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgSearchTerm)); + const nsIMsgSearchTerm = Components.interfaces.nsIMsgSearchTerm; + for each (let term in fixIterator(termsArray, nsIMsgSearchTerm)) { + gSearchSession.appendTerm(term); + } } function CreateGroupedSearchTerms(searchTermsArray)