Merge pull request #2257 from vsemozhetbyt/1.11.8

Fix semicolons, remove old note in 1.11.8
This commit is contained in:
Ilya Kantor 2020-11-10 12:05:14 +03:00 committed by GitHub
commit 48b111d85f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -12,7 +12,7 @@ function loadJson(url) {
} else { } else {
throw new Error(response.status); throw new Error(response.status);
} }
}) });
} }
loadJson('no-such-user.json') loadJson('no-such-user.json')

View file

@ -1,7 +1,7 @@
# Rewrite "rethrow" with async/await # Rewrite "rethrow" with async/await
Below you can find the "rethrow" example from the chapter <info:promise-chaining>. Rewrite it using `async/await` instead of `.then/catch`. Below you can find the "rethrow" example. Rewrite it using `async/await` instead of `.then/catch`.
And get rid of the recursion in favour of a loop in `demoGithubUser`: with `async/await` that becomes easy to do. And get rid of the recursion in favour of a loop in `demoGithubUser`: with `async/await` that becomes easy to do.
@ -22,7 +22,7 @@ function loadJson(url) {
} else { } else {
throw new HttpError(response); throw new HttpError(response);
} }
}) });
} }
// Ask for a user name until github returns a valid user // Ask for a user name until github returns a valid user

View file

@ -156,7 +156,7 @@ class Thenable {
// resolve with this.num*2 after 1000ms // resolve with this.num*2 after 1000ms
setTimeout(() => resolve(this.num * 2), 1000); // (*) setTimeout(() => resolve(this.num * 2), 1000); // (*)
} }
}; }
async function f() { async function f() {
// waits for 1 second, then result becomes 2 // waits for 1 second, then result becomes 2