- ISBN13: 978-1-59059-908-2
- ISBN10: 1-59059-908-X
- 269 pp.
- Published Dec 2007
- Print Book Price: $44.99
- eBook Price: $31.49
Errata Submission
If you think that you've found an error in Pro JavaScript Design Patterns, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.
Errata
| Issue | Author's Response |
|---|---|
| Ch 12, page 162, middle page, code blows up. this.superclass.constructor(bicycle); Code throws an error in TaillightDecorator constructor indicating that superclass is 'undefined' in 'this' object as TaillightDecorator object is being instantiated. In debugger, superclass does exist in instantiated TaillightDecorator object. But not in the "this" object within the TaillightDecorator constructor. |
The constructors for TaillightDecorator and HeadlightDecorator should read as follows: /* TaillightDecorator class. */ var TaillightDecorator = function(bicycle) { // implements Bicycle TaillightDecorator.superclass.constructor.call(this, bicycle); // Call the super-class' constrcutor. } /* HeadlightDecorator class. */ var HeadlightDecorator = function(bicycle) { // implements Bicycle HeadlightDecorator.superclass.constructor.call(this, bicycle); // Call the super-class' constrcutor. } Also, when running this code, be sure to use the version of extend() that sets the superclass attribute (found on p. 44 under the comment /* Extend function, improved. */). |
