From bea8187933e20b905ce3398511960730f446a0ea Mon Sep 17 00:00:00 2001 From: UFOwl Date: Mon, 20 Jun 2016 16:20:05 +0800 Subject: [PATCH 1/2] Update async.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根据后面generator和async的写法,这里似乎应该用of。 --- docs/async.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/async.md b/docs/async.md index 44f0e29..ca39093 100644 --- a/docs/async.md +++ b/docs/async.md @@ -1171,7 +1171,7 @@ function chainAnimationsPromise(elem, animations) { var p = Promise.resolve(); // 使用then方法,添加所有动画 - for(var anim in animations) { + for(var anim of animations) { p = p.then(function(val) { ret = val; return anim(elem); From 42c51c073ecd1739d38fde12524a15263c10a198 Mon Sep 17 00:00:00 2001 From: hawkphantomnet Date: Tue, 28 Jun 2016 00:36:05 +0800 Subject: [PATCH 2/2] Fix typo in async.md --- docs/async.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/async.md b/docs/async.md index 44f0e29..bd170ac 100644 --- a/docs/async.md +++ b/docs/async.md @@ -98,7 +98,7 @@ Promise 的最大问题是代码冗余,原来的任务被Promise 包装了一 举例来说,读取文件的协程写法如下。 ```javascript -function *asnycJob() { +function *asyncJob() { // ...其他代码 var f = yield readFile(fileA); // ...其他代码