javascript-tutorial / javascript-tutorial/en.javascript.info

Problem with sample program in Async Generators and Iterators article

未關閉
#1,775 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
HTML
星號
25.5k
分支
4k
PR 合併指標
30 天內沒有已合併 PR

描述

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;
}
}

})();

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

開啟 Async Generators and Iterators 文章,檢查「An example of use」程式碼片段及其 Open in Sandbox 和 run 連結。重現回報的錯誤,然後更新範例或連結的 samples,讓 fetchCommits 可用,並使程式碼在沒有 Holder 錯誤的情況下執行。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
documentation
Issue 類型
文件
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。