Skip to content

Commit 1a9d77f

Browse files
committed
edit promise
1 parent 990f210 commit 1a9d77f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/generator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ hw.next()
7171
需要注意的是,`yield`语句后面的表达式,只有当调用`next`方法、内部指针指向该语句时才会执行,因此等于为JavaScript提供了手动的“惰性求值”(Lazy Evaluation)的语法功能。
7272

7373
```javascript
74-
function* gen{
74+
function* gen() {
7575
yield 123 + 456;
7676
}
7777
```

docs/promise.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ var getJSON = function(url) {
101101
client.send();
102102

103103
function handler() {
104+
if ( this.readyState !== 4 ) {
105+
return;
106+
}
104107
if (this.status === 200) {
105108
resolve(this.response);
106109
} else {

0 commit comments

Comments
 (0)