By Developers, For Developers

Historical errata for Async JavaScript

PDF PgPaper PgTypeDescriptionFixed onComments
3317ERROR

In the code snippets variables ‘queryStr’ and ‘selectUser’ should be the same
variable, I think.

5136ERROR

var showPromise = $flash.show();
var hidePromise = $flash.hide();

I think they should be:

var showPromise = $flash.show().promise();
var hidePromise = $flash.hide().promise();

7055SUGGEST

I think it’s better to mention that “to invoke the callback function in the worker is a must”, or the queue cannot work properly.

127TYPO

(ePub) Last paragraph, first sentence:

“Node’s error conventions may not ideal for Async.js’s collection methods.”

Should be

“Node’s error conventions may not be ideal for Async.js’s collection methods.”

23TYPO

This is from the LeanPub edition, so the error possibly doesn’t exist (presuming it’s an error).

You list “…under jQuery 1.5+…”
var promise…
promise.done
promise.fail
promise.fail

I believe that the last .fail should be .always. If so, you might have caught this before its current printing.

17TYPO

In the checkPassword function, the query variable is defined as queryStr but used as selectUser.

51TYPO

In Asyncjs/forEachSeries.js code sample, “functio isFilename” has a typo. “function” is missing last ‘n’ (functio).

34ERROR

The jsFiddle referenced is missing the alway() callback used in the text, so it does not log “A choice was made” as the text claims it will.

38ERROR

The book states “So, to recap, a Promise takes three kinds of callbacks: done, fail, and progress.” I believe you are overlooking the fourth callback type, always.

27TYPO

$container.one(‘newTooltip’, function() {
$tooltip.remove();
});
one instead of on

4TYPO

A loop like this will run forever:
var ajaxRequest = new XMLHttpRequest;
ajaxRequest.open(‘GET’, url);
ajaxRequest.send(null);
while (ajaxRequest.readyState = XMLHttpRequest.UNSENT) { // readyState can't change until the loop returns }; Actually it will never run. Shouldn't that be while (ajaxRequest.readyState = XMLHttpRequest.OPENED) {
// readyState can’t change until the loop returns
};

14TYPO

whomever should be whoever around the end of the page

4327TYPO

At the bottom of the page: “$container.one(‘newToolTip’, …” should be “$container.on(’newToolTip, …)”.

Categories: