javascript-tutorial / javascript-tutorial/en.javascript.info
Problem with sample program in Async Generators and Iterators article
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- HTML
- Star
- 25.5k
- Fork
- 4k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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;
}
}
})();
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Mở bài viết Async Generators and Iterators và kiểm tra snippet “An example of use” cùng các liên kết Open in Sandbox và run của nó. Tái hiện các lỗi được báo cáo, sau đó cập nhật ví dụ hoặc các sample được liên kết để fetchCommits khả dụng và mã chạy mà không gặp lỗi Holder.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript
- Lĩnh vực
- documentation
- Loại issue
- Tài liệu
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100