javascript-tutorial / javascript-tutorial/en.javascript.info
Problem with sample program in Async Generators and Iterators article
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 25.5k
- Forks
- 4k
- PR merge metrics
- No merged PRs in 30d
Description
In Plunker, following `Open in Sandbox` link, code provided under "An example of use (shows commit authors in console):" doesn't work (because it doesn't include `fetchCommits` function).
Console shows error:
(index):9 Uncaught (in promise) ReferenceError: fetchCommits is not defined
(index):9 Uncaught (in promise) ReferenceError: fetchCommits is not defined
at (index):9
at (index):18
Running the code directly from the `run` link in article also doesn't work. Gives error:
holder-2.2.min.js:10 Uncaught TypeError: Cannot read property 'appendChild' of undefined
at Object.e.run (holder-2.2.min.js:10)
at holder-2.2.min.js:10
at XMLDocument.h (holder-2.2.min.js:10)
Code in question:
(async () => {
let count = 0;
for await (const commit of fetchCommits('javascript-tutorial/en.javascript.info')) {
console.log(commit.author.login);
if (++count == 100) { // let's stop at 100 commits
break;
}
}
})();
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the Async Generators and Iterators article and inspect the “An example of use” snippet plus its Open in Sandbox and run links. Reproduce the reported errors, then update the example or linked samples so fetchCommits is available and the code runs without the Holder error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100