b=477735; fix XPCOMUtils.generateQI to handle null/undef members in array; r=sayrer
authorVladimir Vukicevic <vladimir@pobox.com>
Tue, 10 Feb 2009 15:10:07 -0800
changeset 24897 0ce096d6b9dfcfa360d94123c9a5a1455bd39b9f
parent 24896 5e9f12e4bddaaf90e6bed31caab086a92b2b2ec6
child 24898 cb3832f7c448d77f89f2d40c471a94507b5cbad1
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssayrer
bugs477735
milestone1.9.2a1pre
b=477735; fix XPCOMUtils.generateQI to handle null/undef members in array; r=sayrer
js/src/xpconnect/loader/XPCOMUtils.jsm
--- a/js/src/xpconnect/loader/XPCOMUtils.jsm
+++ b/js/src/xpconnect/loader/XPCOMUtils.jsm
@@ -107,17 +107,17 @@ const Cr = Components.results;
 var XPCOMUtils = {
   /**
    * Generate a QueryInterface implementation. The returned function must be
    * assigned to the 'QueryInterface' property of a JS object. When invoked on
    * that object, it checks if the given iid is listed in the |interfaces|
    * param, and if it is, returns |this| (the object it was called on).
    */
   generateQI: function(interfaces) {
-    return makeQI([i.name for each(i in interfaces)]);
+    return makeQI([i.name for each (i in interfaces) if (i)]);
   },
 
   /**
    * Generate the NSGetModule function (along with the module definition).
    * See the parameters to generateModule.
    */
   generateNSGetModule: function(componentsArray, postRegister, preUnregister) {
     return function NSGetModule(compMgr, fileSpec) {