Errata

Closure: The Definitive Guide

Errata for Closure: The Definitive Guide

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Other Digital Version 609
last line

On the Amazon Kindle version of the book, using the third smallest font size, page 609 or otherwise under the section "Example: Hello World", subsection "Closure Templates", the compiled version of the soy template does not include the StringBuilder and the output is different, more specifically that the second parameter is "null|undefined" and the JS file requires 'soydata' instead of 'StringBuilder', so the example does not run. Here is my output I receive:

// This file was automatically generated from hello.soy.
// Please don't edit this file by hand.

goog.provide('example.templates');

goog.require('soy');
goog.require('soydata');


/**
* @param {Object.<string, *>=} opt_data
* @param {(null|undefined)=} opt_ignored
* @return {string}
* @notypecheck
*/
example.templates.welcome = function(opt_data, opt_ignored) {
return '<h1 id="greeting">' + soy.$$escapeHtml(opt_data.greeting) + '</h1>The year is ' + soy.$$escapeHtml(opt_data.year) + '.';
};


This is the second code example so it's a little disheartening. I hope the errata can address this.

Michael Hill  Apr 19, 2014 
Other Digital Version 667
1st Paragraph

On the Amazon Kindle version, using the 3rd smallest font size, page 667 (of 14969), or alternatively, under the section "Example: Hello World", subsection "Closure Compiler", the compile fails and it looks like it is because the compiler now requires Java 7 while the book indicates Java 6.

https://github.com/dcodeIO/ClosureCompiler.js/issues/8

Michael Hill  Apr 19, 2014 
Other Digital Version 1081
First Code Sample

In the code example on page 1081 of 14969 on the Amazon Kindle version, or alternatively in Chapter 2 under the section "Special @param Types", subsection "Variable number of parameters, the code example that starts: @param {function(string, string=)} has a typo. A line says this:

@param {function(string, ...[number]}:number}

when it should say

@param{function(string, ...[number]):number}

Michael Hill  Apr 19, 2014