-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed
Labels
invalidIssues and PRs that are invalid.Issues and PRs that are invalid.questionIssues that look for answers.Issues that look for answers.
Description
- version 10.5.0
- Platform Windows 10 Pro
This Code does not recognize "await" with Async Iterator and throws:
async function install(pkg) {
function doIt() {
return new Promise((resolve,reject) => {
console.log('install: ' + pkg);
installPkg(pkg, opts, (err)=> {
err ? reject(err) : resolve(pkg);
});
});
}
return await doIt();
}
async function* installPackages(items) {
for(let key of items) {
let pkg = key + '@' + globalDeps[key];
let result = await install(pkg);
yield result;
}
}
try {
for await (let pkg of installPackages(items)) {
console.log(pkg);
}
}
catch(e) {
console.log(e.stack);
}I was really excited about async generators and installed Node 10.5 but I can't get a thing to work? I tried the --harmony-async-iterator flag but that returns: unsupported flag?
Metadata
Metadata
Assignees
Labels
invalidIssues and PRs that are invalid.Issues and PRs that are invalid.questionIssues that look for answers.Issues that look for answers.