Skip to content

Commit 8916d1c

Browse files
committed
fix(ch5): fix example
1 parent 4f8cfcb commit 8916d1c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Ch5_AsyncFunction/async-function-await.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,8 @@ asyncMain().catch(error => {
9595

9696
次のコードでは、``await``式で発生した例外を``try...catch``構文でキャッチしています。
9797

98-
{{book.console}}
99-
// doctest:async:16
100-
101-
[source,js]
98+
[role="executable"]
99+
[source,javascript]
102100
----
103101
async function asyncMain() {
104102
// await式のエラーはtry...catchできる

Ch5_AsyncFunction/promise-chain-to-async-function.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function fetchResources(resources) {
3333
}
3434
const resources = ["/resource/A", "/resource/B"];
3535
// リソースを取得して出力する
36-
fetchResources().then((results) => {
36+
fetchResources(resources).then((results) => {
3737
console.log(results); // => ["Response body of /resource/A", "Response body of /resource/B"]
3838
});
3939
----

0 commit comments

Comments
 (0)