--- books/www/corrections.html 2003/01/20 16:37:40 1.68 +++ books/www/corrections.html 2003/03/19 11:35:08 1.99 @@ -1,9 +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, @@ -12,31 +12,54 @@ section on the chapter pages, or send a href="mailto:reviewers@mozdev.org">reviewers@mozdev.org mailing list.

Note: All errors in the text and examples are shown in red and all corrections are shown in green. +class="fixed">blue. - +

Preface

- +

Chapter 1

- +

Chapter 2

- +

Chapter 3

- + + +

Chapter 4 + +

+ + +

Chapter 5

- -

Chapter 8 + +

Chapter 6

-
  • On page 222: In Example 8-4 + +

    Chapter 7 -

    - this.myCID, - "My JS Component", - this.myProgID, fileSpec, - location, true, true, - type); - +
      -has been changed to +
    • On page 181: There are 3 errors in Figure 7-2 ...

      - - compMgr.registerComponentWithType( - this.myCID, - "My JS Component", - this.myProgID, fileSpec, - location, true, true, - type); - +1) In the XUL box, 'klabel="Input Field"' should be 'label="Input Field"'

      -
    • On page 222: In Example 8-4 one of the duplicate 'dump(" ***** Registering: Simple JS component! -****\n");' lines has been removed

      +2) In the XBL box, '<binding id+"inputfield">' should be '<binding id="inputfield">'

      -
    • On page 223: In Example 8-4 one of the duplicate 'if (outer != null)' lines has been removed

      +3) In the XBL box, '<xul:label xbl:inherits="value+label"?>' should be '<xul:label xbl:inherits="value=label"/>'

      -
    • On page 239: Example 8-15 has been changed to
      +Here is a correct image (Click for bigger version):

      + +Figure 7-2 + +
    • + +
    + +

    + + +

    Chapter 8 + +

      + +
    • On page 211: In 2nd sentence of paragraph 'QueryInterace' has been +changed to 'QueryInterface'

    • + +
    • On page 222: In Example 8-4 has been changed to: + + +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 239: Example 8-15 has been changed to
    • DEPTH = ../../.. @@ -213,29 +404,54 @@ install:: $(TARGETS) </ul> - -<a name="ch10"> -<p><b>Chapter 10</b> +<a name="ch9"></a> +<p><b>Chapter 9</b> <ul> -<li>On page 297: '<b class="broken">http://www.jslib.mozdev.org</b>' has been changed -to '<b class="fixed">http://jslib.mozdev.org</b>'<br><br></li> -</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

      -
    • On page 314: In Example 11-5 'var linetext = document.createTextNode(messageParagraphs[i]);' -has been changed to 'var linetext = document.createTextNode(lines[i]);'

      -
    • On page 314: In Example 11-6 'var linetext = document.createTextNode(messageParagraphs[i]);' -has been changed to 'var linetext = document.createTextNode(lines[i]);'

      +
    • On page 280: In Table 10-3 'Mostly used for retrieving, datasources, resources, and literals.' has been +changed to 'Mostly used for retrieving datasources, resources, and literals.'

      + +
    • On page 297: 'http://www.jslib.mozdev.org' has been changed to 'http://jslib.mozdev.org'

      +
    - + +

    Chapter 11 + +

      +
    • On page 314: In Example 11-5 and Example 11-6 'var linetext = +document.createTextNode(messageParagraphs[i]);' has been changed to 'var linetext = +document.createTextNode(lines[i]);'

      +
    + + +

    Chapter 12

      @@ -256,15 +472,17 @@ has been changed to (note the difference print ' ' % form['op3'].value +
    - +

    Appendix A

      @@ -274,6 +492,17 @@ class="fixed">http://www.mozilla.org/sou
    + + +

    Index + +

      + +
    • On page 437: 'Chimera, 2' has been changed to 'Camino, 2'

      + +
    + +