Errata: December 8, 2019
The last paragraph of the section before the 'Looking Ahead' callout indicates the preamble bytes but the colon doesn't have a space before the number 0061. It should be:
"...only the preamble bytes: 0061 736d..."
The three annotations for the first two code snippets should have a capital 'P' for the word 'promise.'
The first annotation for the code snippet just before section 'JavaScript object shorthand' should have a capital 'P' for the word 'promise.'
1) The third paragraph, second sentence, doesn't have the 'i' in 'instantiateStreaming' using the same format as the rest of the word.
2) In the same sentence, the word 'promise' should have a capital 'P.'
In Listing 4.3, all the links within the head tag include the text 'W3Schools' which shouldn’t be there. The links should be:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
The paragraph following the snippet for the closing curly brace of the extern "C" block (after Listing 4.9) indicates to copy the 'validate .cpp' file. There shouldn't be a space before the .'cpp' extension. The text should be:
"...copy the validate.cpp file from the..."
1) The annotation for the 'function createPointers(resolve, reject, returnPointers) {' line of code should have a capital 'P' for the word 'promise.'
2) The annotation for the 'resolve();' line of code should have a capital 'P' for the word 'promise.'
3) The annotation for the 'reject(Module.UTF8ToString(errorMessage));' line of code should have a capital 'P' for the word 'promise.'
The closing curly braces of the 'env' object and the parent 'importObject' shouldn't be bold.
1) The annotation for the 'moduleTable.grow' line of code says 'Growa.' It should be 'Grow.a
2) Likewise, the annotation for the 'moduleTable.set' line of code says 'Converta.' It should be 'Convert.'
The annotation for the 'validateCallbacks.resolve();' line of code should have a capital 'P' for 'promise.'
The annotation for the 'validateCallbacks.reject(errorMessage);' line of code should have a capital 'P' for 'promise.'
The word 'promise' at the end of bullets 2 and 3 (resolve and reject) should have a capital 'P.'
1) The annotation for the 'validateNameCallbacks.resolve = resolve;' line of code should have a capital 'P' for the word 'promise.'
2) Likewise for the word 'promise' in the annotation for the 'validateCategoryCallbacks.resolve = resolve;' line of code should have a capital 'P.'
The word 'promise' in the second sentence should have a capital 'P.'
The word "promise's" in the first sentence of the first paragraph should have a capital 'P.'
The word 'promise' in the first sentence of the first bullet point should have a capital 'P.'
The last annotation on the page ('The find_primes module is ready.') is pointing to one line too high. It should be pointing to the following line of code:
.then(module => {
The third paragraph should have the word 'chrono' in the same style as 'high_resolution_clock' to match how 'vector' is formatted in the same paragraph.
In the 'FindPrimes(3, 199999, args[0].primes_found);' line of code, the .'' after 'args[0]' should be bold.
In the first paragraph, second sentence, the path shouldn't have a space between 'Chapter 10\10.3.1 JsPlumbingPrimes\' and 'backend\.' It should be:
Chapter 10\10.3.1 JsPlumbingPrimes\backend\
In the first paragraph, last sentence, the path indicates 'Chapter 3\3.4 js_plumbing\.' It should be:
Chapter 3\3.5 js_plumbing\
In the paragraph before the clientData code snippet, the word 'InitialData' should have a lowercase 'i.' It should be:
initialData
In the paragraph before the clientData code snippet, the word 'InitialData' should have a lowercase 'i.' It should be:
initialData
The last paragraph on the page says .'..validate.js-generated code...' It should be:
...Emscripten-generated code...
The last paragraph on the page, the word 'InitialData' should have a lowercase 'i.' It should be:
initialData
The first bullet indicates the path 'Chapter 3\3.5.1 side_module\.' It should be:
Chapter 3\3.6 side_module\
Some formatting improvements for listing 10.7...
1) The 'moduleTable' line of code should be indented to match the 'const importObject' line of code. There should also be a line feed between the 'moduleTable' and 'const importObject' lines of code.
2) In the 'then' method of the WebAssembly.instantiate call, there should be a linefeed between the 'moduleExports' and 'validateOnSuccessNameIndex' line of code.
3) The 'validateOnSuccessNameIndex' line of code should be indented to match the 'moduleExports' line of code.
4) For the 'validateOnErrorCategoryIndex' lines of code, the closing "}, 'vi');" should be indented to match the 'validateOnErrorCategoryIndex' line of code. It also should be the same font as the rest of the code and not be bold.
5) The 'validateData();' function call should be on its own line and indented to match the 'validateOnErrorCategoryIndex' line of code.
Listing 10.7 should look like the following:
function instantiateWebAssembly(bytes) {
moduleMemory = new WebAssembly.Memory({initial: 256});
moduleTable = new WebAssembly.Table({initial: 1, element: "anyfunc"});
const importObject = {
env: {
__memory_base: 0,
memory: moduleMemory,
__table_base: 0,
table: moduleTable,
abort: function(i) { throw new Error('abort'); },
}
};
WebAssembly.instantiate(bytes, importObject).then(result => {
moduleExports = result.instance.exports;
validateOnSuccessNameIndex = addToTable(() => {
onSuccessCallback(validateNameCallbacks);
}, 'v');
validateOnSuccessCategoryIndex = addToTable(() => {
onSuccessCallback(validateCategoryCallbacks);
}, 'v');
validateOnErrorNameIndex = addToTable((errorMessagePointer) => {
onErrorCallback(validateNameCallbacks, errorMessagePointer);
}, 'vi');
validateOnErrorCategoryIndex = addToTable((errorMessagePointer) => {
onErrorCallback(validateCategoryCallbacks, errorMessagePointer);
}, 'vi');
validateData();
});
}
At the end of the third bullet, it indicates that feature detection was in section 3.6. It should be:
chapter 3, section 3.7
The Text format column value 'elem' isn't formatted the same way as the other words in that column.
In the second paragraph, before the '(func (param i32 i32) (result i32))' snippet, the second sentence says '32-bit' twice but doesn't indicate if it's a 32-bit integer or float. The sentence should be:
The following is an example of a signature that has two 32-bit integer parameters and returns a 32-bit integer value:
In the Purpose column for the _FlipCard item, the last sentence should end with 'it.'
In the last paragraph on the page, removed the word 'the' from before '$ShuffleArray.'
In the second last paragraph before listing 11.7, the word '$index' uses a '$' character that differs from the other '$' characters used throughout the chapter.