mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
edit promise
This commit is contained in:
parent
990f2106be
commit
1a9d77fd7b
@ -71,7 +71,7 @@ hw.next()
|
||||
需要注意的是,`yield`语句后面的表达式,只有当调用`next`方法、内部指针指向该语句时才会执行,因此等于为JavaScript提供了手动的“惰性求值”(Lazy Evaluation)的语法功能。
|
||||
|
||||
```javascript
|
||||
function* gen{
|
||||
function* gen() {
|
||||
yield 123 + 456;
|
||||
}
|
||||
```
|
||||
|
@ -101,6 +101,9 @@ var getJSON = function(url) {
|
||||
client.send();
|
||||
|
||||
function handler() {
|
||||
if ( this.readyState !== 4 ) {
|
||||
return;
|
||||
}
|
||||
if (this.status === 200) {
|
||||
resolve(this.response);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user