--- books/www/corrections.html 2002/12/10 17:16:31 1.47 +++ books/www/corrections.html 2003/03/23 18:54:49 1.104 @@ -1,4 +1,9 @@ -

Corrections + + +

Corrections

This page contains a list of corrections to be made in the next printing of the book. If you have suggestions for changes or find errors in the text, @@ -6,119 +11,398 @@ feel free open a bug section on the chapter pages, or send a message to the reviewers@mozdev.org mailing list. +

Note: All errors in the text and examples are shown in red and all corrections are shown in blue. - +

Preface

- +

Chapter 1

- +

Chapter 2

- +

Chapter 3

+ + + +

Chapter 4 + +

- + +

Chapter 5

-
  • On page 120: 'dump(l+'\n');' has been changed to 'dump(len+'\n');'

    + +

    Chapter 6 -

  • On page 137: 'var connection = Components.classes ["@mozilla.org/network/ldap-connection;1";' has been changed to -'var connection = Components.classes ["@mozilla.org/network/ldap-connection;1"];'

    + - -

    Chapter 8 + +

    Chapter 7

    -
  • On page 239: Example 8-15 has been changed to
    +

    - +<a name="ch08"></a> +<p><b>Chapter 8</b> + +<ul> + +<li>On page 211: In 2nd sentence of paragraph '<b class="broken">QueryInterace</b>' has been +changed to '<b class="fixed">QueryInterface</b>'<br><br></li> + +<li>On page 222: In Example 8-4 has been changed to: + +<xmp class="fixed"> +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; } + +
  • + +
  • On page 237: Example 8-13, line 9 + + NS_INIT_REFCNT( ); // has been depricated use NS_INIT_ISUPPORTS() + mValue = PL_strdup("default value"); + +has been changed to + + // NS_INIT_REFCNT( ); // has been depricated use NS_INIT_ISUPPORTS() + NS_INIT_ISUPPORTS(); + mValue = PL_strdup("default value"); + +
    +
  • + +
  • On page 239: Example 8-15 has been changed to
  • + + DEPTH = ../../.. topsrcdir = ../../.. srcdir = . @@ -159,55 +443,145 @@ install:: $(TARGETS) </ul> +<a name="ch9"></a> +<p><b>Chapter 9</b> + +<ul> + +<li>On page 257: In Example 9-7 + +<xmp class="broken"> + <triple subject="?listitem" + predicate=" http://xfly.mozdev.org/fly-rdf#location" + object="?location"/> + + +has been changed to + + + <triple subject="?listitem" + predicate="fly-location#location" + object="?location"/> + - + + +

    Chapter 10

    - + +

    Chapter 11 + +

    + + +

    Chapter 12

    - +

    Appendix A

    + +

    Index + +

    + +