Diff for /books/www/corrections.html between versions 1.91 and 1.92

version 1.91, 2003/03/14 15:05:02 version 1.92, 2003/03/14 15:09:42
Line 276  has been changed to Line 276  has been changed to
 <li>On page 222: In Example 8-4 one of the duplicate '<b class="broken">dump(" ***** Registering: Simple JS component!  <li>On page 222: In Example 8-4 one of the duplicate '<b class="broken">dump(" ***** Registering: Simple JS component!
 ****\n");</b>' lines has been removed<br><br>  ****\n");</b>' lines has been removed<br><br>
   
   <xmp>
   
   function SimpleComponent(){}
   
   SimpleComponent.prototype = {
   
       get yourName()        { return this.mName; },
       set yourName(aName)   { return this.mName = aName; },
   
       write: function () { dump("Hello " + this.mName + "\n"); },
       change: function (aValue) { this.mName = aValue; },
       mName: "a default value",
   
       QueryInterface: function (iid) {
           if (!iid.equals(Components.interfaces.nsISimple)
               && !iid.equals(Components.interfaces.nsISupports))
           {
               throw Components.results.NS_ERROR_NO_INTERFACE;
           }
           return this;
       }
   }
   
   var Module = {
       firstTime: true,
   
       registerSelf: function (compMgr, fileSpec, location, type) {
           if (this.firstTime) {
               dump("*** Deferring registration of simple JS components\n");
               this.firstTime = false;
               throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN;
           }
           debug("*** Registering sample JS components\n");
           compMgr =
   compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
           compMgr.registerFactoryLocation(this.myCID,
                                           "Simple JS Component",
                                           this.myProgID,
                                           fileSpec,
                                           location,
                                           type);
       },
   
       getClassObject : function (compMgr, cid, iid) {
           if (!cid.equals(this.myCID))
           throw Components.results.NS_ERROR_NO_INTERFACE
           if (!iid.equals(Components.interfaces.nsIFactory))
           throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
           return this.myFactory;
       },
   
       myCID: Components.ID("{98aa9afd-8b08-415b-91ed-01916a130d16}"),
       myProgID: "@mozilla.org/js_simple_component;1",
   
       myFactory: {
           createInstance: function (outer, iid) {
               dump("CI: " + iid + "\n");
               if (outer != null)
               throw Components.results.NS_ERROR_NO_AGGREGATION;
               return (new SimpleComponent()).QueryInterface(iid);
           }
       },
   
       canUnload: function(compMgr) {
           dump("****** Unloading: Simple JS component! ****** \n");
           return true;
       }
   }; // END Module
   
   function NSGetModule(compMgr, fileSpec) { return Module; }
   
   </xmp>
   <br><br>
   </li>
   
 <li>On page 223: In Example 8-4 one of the duplicate '<b class="broken">if (outer != null)</b>' lines has been removed<br><br>  <li>On page 223: In Example 8-4 one of the duplicate '<b class="broken">if (outer != null)</b>' lines has been removed<br><br>
   
<li>On page 239: Example 8-15 has been changed to <br/><li>On page 222: In Example 8-4 has been changed to:</li>
 <li>On page 239: Example 8-15 has been changed to <br/></li>
   
 <xmp class="fixed">  <xmp class="fixed">
 DEPTH         = ../../..  DEPTH         = ../../..

Removed from v.1.91  
changed lines
  Added in v.1.92


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>