Skip to content

Commit 7a5cf35

Browse files
[WebIDL] Editorial: note that Promise<T> arguments also accept T whatwg/webidl@e1300e9
1 parent 913411b commit 7a5cf35

2 files changed

Lines changed: 69 additions & 31 deletions

File tree

WebIDL-JS-ja.html

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@
305305
●●options
306306

307307
spec_title:Web IDL Standard
308-
trans_update:2025-11-30
308+
trans_update:2026-03-30
309309
original_url:https://webidl.spec.whatwg.org/
310310
abbr_url:WEBIDLjs
311311
page_state_key:WEBIDL
@@ -1388,6 +1388,8 @@
13881388
的確:right:~
13891389
責務:responsibility:~
13901390
続行-:proceed:~
1391+
機構:machinery:~
1392+
間違った:wrongな:~
13911393

13921394
~~問題ない:Fine;
13931395
標準でない:non-standard
@@ -1533,7 +1535,7 @@
15331535

15341536
/-:known
15351537
最低:lowest
1536-
最終的に:eventual
1538+
最終的:eventual
15371539
最長:longest
15381540
唯一の:only
15391541
後続:
@@ -1673,6 +1675,7 @@
16731675
%個数:count
16741676
%引数~宣言~list:-
16751677
%事由:reason
1678+
%事由:r
16761679
%作成したか:created
16771680
%作成するか:creating
16781681
%名前:name
@@ -1835,7 +1838,6 @@
18351838
%p
18361839
%proto
18371840
%prototype
1838-
%r
18391841
%target
18401842
%v
18411843
%x
@@ -2590,7 +2592,7 @@ <h4 title="Integer types">3.2.4. 整数~型</h4>
25902592
Let x be ? ConvertToInt(V, _N_, "signed|unsigned").
25912593
</li>
25922594
<li>
2593-
~RET %x と同じ数量-値を表現する,%T ~IDL値
2595+
~RET %x と同じ数量-値を表現する,%T 型の~IDL値
25942596
25952597
Return the IDL _T_ value that represents the same numeric value as x.
25962598
</li>
@@ -5086,16 +5088,53 @@ <h4 title="Promise types — Promise&lt;T&gt;">3.2.24. ~promise型 — ~promise_
50865088
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.
50875089
</p>
50885090

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&lt;T&gt; 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&lt;T&gt; 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+
50895128
<section id="js-promise-manipulation">
50905129
<h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法と操作-法</h5>
50915130

50925131
<div class="algo">
50935132
<p>
50945133
`新たな~promise@
50955134
( `a new promise^en )
5096-
5097-
— ~realm内に新たな `~promise_T$ を†
5098-
作成する~algoは、
5135+
を作成する
5136+
— ~realm内に新たな `~promise_T$ †を作成する
5137+
~algoは、
50995138
所与の
51005139
( `~realm$ %~realm )
51015140
に対し:
@@ -5180,7 +5219,7 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
51805219
%値 が~IDL値を期待する文脈で利用される所では、
51815220
暗黙的に~IDL値に変換されることになる
51825221
(例: ~promise_T を返す~APIにおいては、
5183-
%T 型の~IDL値に変換される)。
5222+
~IDL %T 型の値に変換される)。
51845223
】</p>
51855224
</div>
51865225

@@ -5233,7 +5272,7 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
52335272
( `resolve^en する)
52345273
~algoは、
52355274
所与の
5236-
( `~promise_T$ %p, %T の値 %x ~DF `undefined$T 値 )
5275+
( `~promise_T$ %p, %T 型の値 %x ~DF `undefined$T 値 )
52375276
に対し:
52385277
52395278
To resolve a Promise&lt;T&gt; p with x (a value of type T), perform the following steps:
@@ -5272,22 +5311,22 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
52725311
( `reject^en する)
52735312
~algoは、
52745313
所与の
5275-
( `~promise_T$ %p, ~JS値 %r )
5276-
に対し( %r が事由を与える)
5314+
( `~promise_T$ %p, ~JS値 %事由 )
5315+
に対し:
52775316
52785317
To reject a Promise&lt;T&gt; p with reason r (a JavaScript value), perform the following steps:
52795318
</p>
52805319
<ol>
52815320
<li>
5282-
~NOABRUPT `Call$A( %p.`Reject^sl, `undefined^jv, « %r » )
5321+
~NOABRUPT `Call$A( %p.`Reject^sl, `undefined^jv, « %事由 » )
52835322
52845323
Perform ! Call(p.[[Reject]], undefined, « r »).
52855324
</li>
52865325
</ol>
52875326

52885327
<p class="trans-note">【
52895328
これは、
5290-
“ %x で %p を却下する”
5329+
“ %事由 で %p を却下する”
52915330
の様な形の句で参照されることもある。
52925331
】</p>
52935332
</div>
@@ -5447,7 +5486,7 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
54475486
`~promise_T$ %~promise の
54485487
`充足-時@
54495488
( `upon fulfillment^en )に[
5450-
%T の値を引数にとる何らかの手続き %手続き
5489+
%T 型の値を引数にとる何らかの手続き %手続き
54515490
]を遂行するようにするときは:
54525491
54535492
To perform some steps upon fulfillment of a Promise&lt;T&gt; promise given some steps steps taking a value of type T, perform the following steps:
@@ -5491,9 +5530,9 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
54915530
<ul>
54925531
<li class="algo">
54935532
`却下~手続き^i は、
5494-
所与の ( 事由 %r ) に対し
5533+
所与の ( %事由 ) に対し
54955534
5496-
%手続き( %r )
5535+
%手続き( %事由 )
54975536
</li>
54985537
</ul>
54995538
@@ -5506,7 +5545,8 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
55065545
<p class="trans-note">【
55075546
同じ箇所に[
55085547
`充足-時$の手続き, `却下-時$の手続き
5509-
]両者が与えられている所では、
5548+
]両者が与えられることもある
5549+
— その事例では、
55105550
`~promiseに反応する$ときに両~手続きとも渡すことになろう。
55115551
】</p>
55125552
</div>
@@ -5709,8 +5749,7 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
57095749
<ol>
57105750
<li>
57115751
%~promise ~LET
5712-
型 <code>`Promise$T&lt;`~sequence_T$&gt;</code>
5713-
の`新たな~promise$( %~realm )
5752+
<code>`Promise$T&lt;`~sequence_T$&gt;</code> 型の`新たな~promise$( %~realm )
57145753
57155754
Let promise be a new promise of type Promise&lt;sequence&lt;T&gt;&gt; in realm.
57165755
</li>
@@ -5768,7 +5807,7 @@ <h5 title="Creating and manipulating Promises">3.2.24.1. ~promiseの作成-法
57685807
<div class="algo">
57695808
<p>
57705809
`~promiseを取扱済みとして~markする@
5771-
( `mark as handled^en )ときは
5810+
( `mark as handled^en )~algoは
57725811
所与の
57735812
( `~promise_T$ %~promise )
57745813
に対し
@@ -6068,7 +6107,7 @@ <h5 title="Examples">3.2.24.2. 例</h5>
60686107
<li class="algo">
60696108
<p>
60706109
`却下~手続き^i は、
6071-
所与の ( 事由 %r ) に対し:
6110+
所与の ( %事由 ) に対し:
60726111
60736112
If promise was rejected with reason r, then:
60746113
</p>
@@ -6093,7 +6132,7 @@ <h5 title="Examples">3.2.24.2. 例</h5>
60936132
<div class="algo">
60946133
手続きは
60956134
6096-
`~promiseを却下する$( %p, %r )
6135+
`~promiseを却下する$( %p, %事由 )
60976136
</div>
60986137
60996138
Queue a task on taskSource to reject p with r.
@@ -6115,7 +6154,7 @@ <h5 title="Examples">3.2.24.2. 例</h5>
61156154

61166155
<div class="example" id="promise-example-environment-ready">
61176156
<p>
6118-
%環境.`ready^c 、[
6157+
`Environment^T の `ready^c 属性は、[
61196158
ある環境(例:~DOM文書)を成す何らかの部分が “準備済み” になるとき
61206159
]を通達する`属性$である。
61216160
それは、
@@ -6132,8 +6171,7 @@ <h5 title="Examples">3.2.24.2. 例</h5>
61326171

61336172
<p>
61346173
どの `Environment^T ~objも
6135-
<code>`Promise$T&lt;`undefined$T&gt;</code>
6136-
型の
6174+
<code>`Promise$T&lt;`undefined$T&gt;</code> 型の
61376175
`準備済み~promise@
61386176
を有するモノトスル。
61396177
@@ -6158,7 +6196,7 @@ <h5 title="Examples">3.2.24.2. 例</h5>
61586196
<div class="algo">
61596197
<p>
61606198
`~realm$ %~realm 内で `Environment^T ~objを作成するときは、
6161-
次~手続きを遂行する
6199+
次の手続きを遂行する
61626200
61636201
To create an Environment object in a realm realm, perform the following steps:
61646202
</p>
@@ -7866,7 +7904,7 @@ <h4 title="Frozen arrays — FrozenArray&lt;T&gt;">3.2.27. 凍結d配列 — ~Fr
78667904
`凍結d配列を作成する@
78677905
~algoは、
78687906
所与の
7869-
( %T の値たちが成す連列 %S )
7907+
( %T 型の値たちが成す連列 %S )
78707908
に対し:
78717909
78727910
To create a frozen array from a sequence of values of type T, follow these steps:
@@ -22190,7 +22228,7 @@ <h4 title="Creating and throwing exceptions">3.14.3. 例外の作成-法と投
2219022228

2219122229
<div class="algo">
2219222230
<p>
22193-
%T `単純~例外$用に`例外を作成する$ときは:
22231+
%T 型の`単純~例外$用に`例外を作成する$ときは:
2219422232
2219522233
To create a simple exception of type T:
2219622234
</p>

WebIDL-ja.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@
471471
●●options
472472

473473
spec_title:Web IDL Standard
474-
spec_date:2026-03-16
474+
spec_date:2026-03-27
475475
trans_update:2025-09-25
476476
source_checked:250915
477477
original_url:https://webidl.spec.whatwg.org/
@@ -2271,7 +2271,7 @@
22712271
[WASM-JS-API-1]
22722272
Daniel Ehrenberg. <WebAssembly JavaScript Interface>. URL: https://webassembly.github.io/spec/js-api/
22732273
[WASM-JS-API-2]
2274-
. Ms2ger. <WebAssembly JavaScript Interface>. URL: https://webassembly.github.io/spec/js-api/
2274+
. Ms2ger; Ryan Hunt. <WebAssembly JavaScript Interface>. URL: https://webassembly.github.io/spec/js-api/
22752275
[XML-NAMES]
22762276
Tim Bray; et al. <Namespaces in XML 1.0 (Third Edition). 8 December 2009. REC. URL: https://www.w3.org/TR/xml-names/
22772277

@@ -2298,7 +2298,7 @@
22982298

22992299
Commits
23002300
<a href="https://github.com/whatwg/webidl/commits">GitHub whatwg/webidl/commits</a>
2301-
<a href="https://webidl.spec.whatwg.org/commit-snapshots/a652053f1e74e4aaf647528deb174012ed6c909f/" id="commit-snapshot-link">Snapshot as of this commit</a>
2301+
<a href="https://webidl.spec.whatwg.org/commit-snapshots/e1300e95ea6598de45d79823ca72c9bd12852696/" id="commit-snapshot-link">Snapshot as of this commit</a>
23022302
<a href="https://twitter.com/webidl">@webidl</a>
23032303

23042304
Tests

0 commit comments

Comments
 (0)