You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result of converting an IDL promise type value to a JavaScript value is the value of the [[Promise]] field of the record that IDL promise type represents.
5087
5089
</p>
5088
5090
5091
+
<div class="note">
5092
+
<p>注記:
5093
+
~JS値を~IDL `~promise_T$ 型の値へ変換するときは、
5094
+
当の値は,先ず(~IDL) `Promise$T 内に包装されてから、
5095
+
後の機構が[
5096
+
当の~promiseが %T 型の値へ正しく解決される
5097
+
]ことを確保する。
5098
+
◎
5099
+
When converting a JS value to a Promise<T> IDL value, first the value is wrapped in an (IDL) Promise, then later machinery ensures the promise correctly resolves to a value of type T.
5100
+
</p>
5101
+
5102
+
<p>
5103
+
このことは、
5104
+
例えば[
5105
+
`~promise_T$ 型の引数をとるものと定義された~method
5106
+
]は,[
5107
+
`~promise_T$ ~obj
5108
+
(それは,最終的に %T 型の~obj†へ解決されなければならない),
5109
+
%T 型の~obj†
5110
+
]どちらも自動的に受容することになることを意味する。
5111
+
【† %T は~obj型とは限らないので(整数~型など),単に “値” であろう。】
5112
+
◎
5113
+
This means that, for example, a method defined to take a Promise<T> argument will automatically accept both Promise objects (which must eventually resolve to a T object) and T objects themselves.
5114
+
</p>
5115
+
5116
+
<p>
5117
+
(それは、
5118
+
初期~時には[
5119
+
`他のどの^em型の~objも受容する
5120
+
]が,最終的には[
5121
+
当の~promiseを間違った型へ解決する際に,自動-却下する
5122
+
]ことになる。)
5123
+
◎
5124
+
(It will also, initially, accept any other type of object, but will eventually auto-reject the promise for resolving to the wrong type.)
5125
+
</p>
5126
+
</div>
5127
+
5089
5128
<section id="js-promise-manipulation">
5090
5129
<h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法と操作-法</h5>
5091
5130
5092
5131
<div class="algo">
5093
5132
<p>
5094
5133
`新たな~promise@
5095
5134
( `a new promise^en )
5096
-
を
5097
-
— ~realm内に新たな `~promise_T$ を† —
5098
-
作成する~algoは、
5135
+
を作成する
5136
+
— ~realm内に新たな `~promise_T$ †を作成する —
5137
+
~algoは、
5099
5138
所与の
5100
5139
( `~realm$ %~realm )
5101
5140
に対し:
@@ -5180,7 +5219,7 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
5180
5219
%値 が~IDL値を期待する文脈で利用される所では、
5181
5220
暗黙的に~IDL値に変換されることになる
5182
5221
(例: ~promise_T を返す~APIにおいては、
5183
-
%T 型の~IDL値に変換される)。
5222
+
~IDL %T 型の値に変換される)。
5184
5223
】</p>
5185
5224
</div>
5186
5225
@@ -5233,7 +5272,7 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
<ahref="https://webidl.spec.whatwg.org/commit-snapshots/a652053f1e74e4aaf647528deb174012ed6c909f/"id="commit-snapshot-link">Snapshot as of this commit</a>
2301
+
<ahref="https://webidl.spec.whatwg.org/commit-snapshots/e1300e95ea6598de45d79823ca72c9bd12852696/"id="commit-snapshot-link">Snapshot as of this commit</a>
0 commit comments