Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix a couple minor errors in README examples #188

Merged
merged 2 commits into from

2 participants

@ceedubs

Most of the examples of async.parallel correctly show the callback as taking (err, results), but one of them just shows (results). This would not work well if somebody followed it as an example.

Also, several of the examples have trailing commas in their arrays. I know this will make IE angry, and possibly other JS engines.

ceedubs added some commits
@ceedubs ceedubs Add missing 'err' parameter to example of async.parallel in README b5895fa
@ceedubs ceedubs Delete trailing commas in lists of README examples
Some, if not all, versions of IE will fail on trailing commas. I don't know, but it might be a problem for some other JS engines as well.
b8fa37d
@caolan caolan merged commit bbfed60 into caolan:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 16, 2012
  1. @ceedubs
  2. @ceedubs

    Delete trailing commas in lists of README examples

    ceedubs authored
    Some, if not all, versions of IE will fail on trailing commas. I don't know, but it might be a problem for some other JS engines as well.
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 6 deletions.
  1. +6 −6 README.md
View
12 README.md
@@ -537,7 +537,7 @@ async.series([
function(callback){
// do some more stuff ...
callback(null, 'two');
- },
+ }
],
// optional callback
function(err, results){
@@ -556,7 +556,7 @@ async.series({
setTimeout(function(){
callback(null, 2);
}, 100);
- },
+ }
},
function(err, results) {
// results is now equal to: {one: 1, two: 2}
@@ -601,7 +601,7 @@ async.parallel([
setTimeout(function(){
callback(null, 'two');
}, 100);
- },
+ }
],
// optional callback
function(err, results){
@@ -621,7 +621,7 @@ async.parallel({
setTimeout(function(){
callback(null, 2);
}, 100);
- },
+ }
},
function(err, results) {
// results is now equals to: {one: 1, two: 2}
@@ -836,7 +836,7 @@ async.parallel([
// this is run at the same time as getting the data
}
],
-function(results){
+function(err, results){
async.series([
function(callback){
// once there is some data and the directory exists,
@@ -925,7 +925,7 @@ async.parallel([
},
function(callback){
fs.writeFile('testfile2', 'test2', callback);
- },
+ }
]);
```
Something went wrong with that request. Please try again.