diff --git a/WebIDL-ja.html b/WebIDL-ja.html
index 209af7adb..069469c53 100644
--- a/WebIDL-ja.html
+++ b/WebIDL-ja.html
@@ -401,7 +401,7 @@
promise_T:Promise<T>
sequence_T:sequence<T>
FrozenArray_T:FrozenArray<T>
-
+toJSON: toJSON
varT:T
iterator0:@@iterator
Promise_resolve:%Promise_resolve%
@@ -441,7 +441,6 @@
原型鎖:prototype chain::::プロトタイプチェイン
tok:token:::トークン
-optional::::オプション
随意:optional::::オプショナル
随意の:optional::::オプショナル
随意~引数
@@ -449,6 +448,7 @@
省略可:optional::~
必須:required::~
必須の:required::~
+ ~~不可欠:required to
必須:non-optional
引数:argument:~
引数個数:argument count:~
@@ -521,11 +521,10 @@
descriptor::::記述子:デスクリプタ
field::::フィールド
instance::::インスタンス
-host::::ホスト
nullable:
-null:
view:::::ビュー
class:::::クラス
+JSON:
可 null
多重定義:overload::~::オーバーロード
有効:effective:~
@@ -541,6 +540,8 @@
platform:::::プラットフォーム
予約済み:reserved:~
予約済みの:reserved:~
+予約-:reserve:~
+識別-:identify::~
識別子:identifier::~
構築子:constructor:::~:コンストラクタ
取得子:getter:::~:ゲッタ
@@ -554,15 +555,9 @@
旧来:legacy:::~
旧来の:legacy:::~
LegacyWindowAlias:legacy window alias
-直列化-:serialize:::~:シリアライズ
-直列化子:serializer:::~:シリアライザ
-直列化:serialization:::~:シリアル化
- シリアライゼーション
-直列形の:serialized:::~:シリアル形の
- 直列化された形:serialized form
-直列化可能:serializable:::~:シリアライズ可能
map:::::マップ
set:::::セット
+stack:::::スタック
slot:::::スロット
buffer:::::バッファ
source:::::ソース
@@ -611,7 +606,6 @@
真偽:boolean::~
自前の:own::~
native:::::ネイティブ
-flag:::::フラグ
大域:global:::~:グローバル
環境:environment:~
大域環境:global environment:global 環境:~::グローバル環境
@@ -645,9 +639,8 @@
error::::エラー
script::::スクリプト
-stack::::スタック
trace::::トレース
-snapshot::::スナップショット
+stack-trace:stack trace:::スタックトレース
scope::::スコープ
octet::::オクテット
@@ -659,7 +652,6 @@
realm:
configurable:
typedef:
-valuetype:
completion:
普通の:ordinary::~
@@ -667,10 +659,10 @@
保安的:secure::~:セキュア
保安的でない:insecure
符号位置:code point::~::コードポイント
-注釈文:prose:~:::プローズ
+注釈文:prose::~::プローズ
隠蔽:shadow:~
言語:language:~
-合致:match:~:::マッチ
+合致:match::~::マッチ
日付時刻:time:~
時刻:time:~
変数:variable:~
@@ -681,22 +673,15 @@
entry::::エントリ
item::::アイテム
項目/一員
-識別-:identify:~
-宣言:declaration:~
-宣言-:declare:~
長さ:length:~
writable::書き込み可能
妥当:valid:~
invalid
-解決:resolution:~:::レゾリューション
-解決-:resolve:~:::リゾルブ
-実装:implementation:~
-実装-:implement:~
-実装者:implementor:~
+宣言:declaration::~
+宣言-:declare::~
+解決:resolution::~::レゾリューション
+解決-:resolve::~::リゾルブ
伝播-:propagate:~
-適合:conforming:~
-適合性:conformance:~
-test-suite:test suite:::テスト一式:テストスイート
初期:initial:~
要素:element:~
範囲:range:~
@@ -706,7 +691,7 @@
文脈:context::~
評価-:evaluate:~
等価:equivalent:~
-構文:syntax:~:::シンタックス
+構文:syntax::~::シンタックス
特徴:characteristics:~
文法:grammar:~:::グラマー
@@ -742,9 +727,6 @@
既存の:existing:~
空:empty:~
空の:empty:~
-指定-:specify:~
-所与の:given:与えられた
-
設定群:settings:~
●動詞
@@ -774,8 +756,9 @@
除去-:remove:~
付加-:append:~
追加-:add:~
+追加:addition:~
追加の:additional:~
- 追加で
+追加で:additional に:~
試み:attempt:~
試みて:attempt して:~
試みる:attempt する:~
@@ -829,8 +812,9 @@
用いる:use する:~
用いら:use さ:~
用いて:use して:~
+ 利用~中:in use
+ 用法:usage
存在-:exist:~
- 存在t-:present:存在
在する:present する:在る
存在t:presence:存在
不在:not present:~
@@ -885,13 +869,10 @@
見出せ:find でき:~
転送-:forward:~
準備-:prepare:~
-
-代理:proxy:~
-抽象:abstract:~
- 抽象~演算
-抽象的:abstract:~
-仮数:significand:~
-偶数:even:~
+収集-:collect:~
+ 転換-:turn into
+pop:
+push:
●仕様
Web:
@@ -899,10 +880,9 @@
特色機能:feature::~::フィーチャ
仕様:spec:~
省略符号:ellipsis:~
-特有:-specific:ごとに固有
-特有の:specific な:固有の
+特有に:-specific:ごとに特有に
+特有の:specific な:~
特定の:specific な:~
-固有の:specific:~
文書:document:~
暗黙的:implicit:~
明示的:explicit:~
@@ -912,6 +892,7 @@
相互運用性:interoperability:~
level:::レベル
互換性:compatibility:~
+互換:compatible:~
技術報告:technical reports:~
独立:independent:~
通用する:agnostic な:~
@@ -919,8 +900,9 @@
mailing-list:mailing list::メーリングリスト
bug:::バグ
リンク:link:~
-規定:normative:~
-参考:informative:~
+規範的:normative:~
+規範:normative:~
+ 参考:informative:~
詳細:details:~
意味論:semantics:~:::セマンティクス
判定基準:criteria:~
@@ -930,6 +912,7 @@
手続き:action
系列:variety:~
便宜性:facility:~
+ 便宜:convenience
実質的:effective:~
実質的:In effect,
共通の:common:~
@@ -951,8 +934,10 @@
特定0の:particular:ある特定の
概して:typical に:~
誤った:wrong
+ 誤った:erroneous
勧める:suggest する:~
一貫する:consistent になる:~
+ 終始:consistently
能:ability:~
通常通り:as normal に:通常どおり
仕方:way:~
@@ -996,12 +981,78 @@
人為的:artificial:~
理由:reason:~
手引き:guide:~
+クラス:class::~
+事例:case:~
+相応しく:suitableに:~
+
よく見れば:The astute reader may
よく似ている:very similar
少しばかり/もう少し:slightly
代替:alternative:~
+ ~~理由:because
+ 用語例
+ 用途:purpose/
+ 目的:purpose
+ 通常:regular/Fine/
+ 通常の: normal な:~
+ 通常のようにnormally
+ 可能
+ 必要
+ 不要
+ 候補:possible
+ 側面:aspect
+ 通例:usually/usual
+ 通例の:
+ 具体的な:concrete:~
+ 分類:categories/
+ ~~問題ない:Fine;
+ 問題:matter
+ 孕まれる問題:problematic
+ 方法:how
+ 手段:means:~
+ ~~概念:notion:~ 1
+ 概略的:Informally
+ 用例:examples of
+ 編集を補助する:editorial aide
+ 編集者:editor
+ 編集者草案:editor’s draft
+ 草案:draft:~
+ ~~自動的:no need to also
+ ~~確認:checked to ensure
+ 表記:
+ 表記規約:typographic convention:~
+ 記述例:example
+ 謝意
+ 謝辞:acknowledgements
+ 因る:due to
+ 有意になる:has significance
+ ~~例外
+ 何故
+ 参照文献
+ 参考例
+ 図式:diagram
+ 基礎的
+ 意図的:deliberate
+ -:be true
+ 手法:methods
+ 把握:unaware
+ 容易く:easily
+ 休み:unavailable to do so
+ もまた,:By extension,
+ 対照的に:In contrast
+ -:terminology
+ 場合分: 2
+ 増補:grow
+ 明白:clear
+ 明確には:Specifically
●仕様(動詞
+指定-:specify:~
+実装:implementation:~
+実装-:implement:~
+実装者:implementor:~
+適合:conforming:~
+適合性:conformance:~
言明-:state:~
予期-:expect:~
期待-:expect:~
@@ -1066,16 +1117,16 @@
説明:explanation/description:~
遂行-:perform:~
保全-:preserve:~
-決断:decision:~
+決める:decide する:~
+ decision
見なさ:consider さ:~
考える:consider する:~
- 考慮に入れ:consider
+考慮-:consider:~
見做す:assume する:~
見做さ:assume さ:~
計画-:plan
発行-:publish:~
確保-:ensure:~
- 気付く:notice
奨励-:encourage:~
しないことが奨励:discourage:~
否認-:deny:~
@@ -1084,6 +1135,41 @@
単純化-:simplify:~
言及-:mention:~
望ましくない:undesirable
+ 注記:note:~
+ 警告:warning:~
+ 課題:issue:~
+ 気付く/注意:notice
+ 注意:Note that
+ 取り組まれ:address され
+ 出荷-:ship
+ 惑わす:confusing
+ ~~特別な:discriminated
+ 保守-:maintain
+ 表出:
+ 表現力:expressiveness:~
+ 見受:
+ 見通:
+ 解消:
+ ~~調整を通す:coordinate
+ 意味:mean/meaning
+ ~~意味がある:it makes sense
+ 集約
+ 極力~避ける:strongly discouraged
+ 混同:looking like
+ ~~意図的に:deliberate
+ ~~提出:file
+ ~~入力にとる:take
+ ~~入力の:incoming
+ 順繰りに挙げ:loop through
+
+ 交換可能に:interchangeably
+ 強調-:highlight
+ 予測し得ない:unpredictable
+ 細心の注意を払う必要がある:Extreme care must be taken
+ 見つけ易くする:help 〜 look for
+ 付与:mark/
+ 感謝
+ ~~寄与:adhere/contributing
●未分類(動詞
変異:mutation::~
@@ -1099,6 +1185,8 @@
順序付けら:order さ:~
有順序:ordered:~
全順序:total order:~
+ 昇順
+ 降順
実行:execution:~
実行-:execute:~
実行-可能:executable
@@ -1127,9 +1215,65 @@
共有-:share:~
見よ:see
生じ:occur
-
+中止-:abort:~
+動作:action:~
+操作-:manipulate:~
+操作:manipulation:~
+整列-:sort:~
+検出-:detect:~
+ detection
+ 供され:supplied
+ 置く:place
+ 前に〜を置く:precede
+ 対応-:correspond:~
+ 対応付ける:map する:~/correspond
+ 合格-:pass:~
+ 遭遇-:encounter:~
+ 選択-:choose
+ 重複:duplicates
+ 開始:start
+ 関係:
+ 関係無い:unrelated
+ なくする:prevent
+ listed in 〜/
+ 含む:include
+ 指す:refer
+ 指す:address
+ 束ねる:bundle する
+ 用いられる:trigger する
+ 表す:denote
+ 包含-:contain
+ 挿入-:insert
+ 出自に:originate
+ 実現:done
+ 変形-:
+ 導入:
+ 応答:responding
+ 併用:declared with/
+ ~~併合:mixed
+ ~~供給-:-
+ ~~区別-:-
+ 行われ:carry out
+
●未分類
+代理:proxy:~
+抽象:abstract:~
+ 抽象~演算
+仮数:significand:~
+偶数:even:~
+
Unicode:
+UTF-16:
+protocol:::プロトコル
+binary:::バイナリ
+network:::ネットワーク
+transaction:::トランザクション
+database:::データベース
+mode:::モード
+polyfill:
+mixin:
+mix-in:mix in
+font::::フォント
singleton:
最小:shortest
series
@@ -1164,13 +1308,10 @@
browser:::ブラウザ
clone:::クローン
主thread:main thread::メインスレッド
-テスト:testing::~
project::::プロジェクト
node:::ノード
graph:::グラフ
parameter:::パラメタ
-hook:::フック
-クラス:class::~
page:::ページ
text:::テキスト
event-handler:event handler:::イベントハンドラ
@@ -1191,27 +1332,6 @@
不可視:invisible:~
可視:visible:~
-現在の:current:~
-現在:currently:~
- 最初の:first
- 最後の:last:~
- 個目:first/second/third:~
- 結果:result:~
- 注記:note:~
- 警告:warning:~
- 課題:issue:~
-
-
- ●低頻度
-protocol:::プロトコル
-binary:::バイナリ
-network:::ネットワーク
-transaction:::トランザクション
-database:::データベース
-mode:::モード
-polyfill:
-mixin:
-mix-in:mix in
非同期:asynchronous:~
同一性:identity:~
実体:entity:~
@@ -1224,13 +1344,13 @@
記憶域:memory::~::メモリ
木:tree::~::ツリー
下層の:undelying:~
- 節:section:~
- 一覧:table:~
+ 節:section
+ 下位~節:sub-section
+ 一覧:table
内容:contents:~
匿名:anonymous:~
数学的:mathematical:~
数学的実数:mathematical real number:~
-hyphen:::ハイフン
連続的な:contiguous:~
平方根:square root:~
内側:inside:~
@@ -1238,9 +1358,104 @@
単語:word:~
命名法:naming scheme:~
本体:body:~
-
関連する:relevant な:~
-font::::フォント
+
+ ●指示語
+所与の:given:与えられた
+現在の:current:~
+現在:currently:~
+ 最初の:first
+ 最後の:last:~
+ 個目:first/second/third:~
+ 結果:result:~
+ この:this
+ その:that
+ 各:each
+ 別の:another
+ そのような:such
+ など:such as
+ 直後:
+ 種別:
+ 多少:
+ 種:
+ 項:
+ 合間:
+ 余分:
+ 個
+ 個別:
+ 全体:
+ 前回:
+ 前段:
+ 前述:
+ 前項:
+ 既知の:known
+ 未知の:unknown
+ 最低:lowest
+ 最新の:latest
+ 最終的:
+ 最良:
+ 最長:longest
+ 次項:
+ 唯一の:only
+ 常に:always
+ 同じ:the same
+ 後続:
+ 同様:
+ 自身:
+ 複数:
+ 以上
+ 以下
+ 以外
+ 任意:
+ 場合:
+ 部分:
+ 最大:
+ 最小:
+ 類似:
+ 片方
+ 他方
+ 一方
+ 両者
+ 両方
+ 両方同時
+ 一連
+ 一部
+ 広義
+ 時点
+ 末尾
+ 後者:
+ 前者:
+ 末端:most-derived/
+ 先頭
+ 下端:
+ 右側:right-hand side/right
+ 左側:left-hand side/left
+ 場所:
+ 個数:
+ 一定の/ある種の:certain
+ 一環:as part of
+ 一種:
+ 上述:
+ 一時的:
+ 今度:this time
+ 上限:
+ 中心:
+ 即時:immediately
+ 以前:
+ 同時:
+ 周囲:
+ 左右:
+ 広範囲:wide
+ 類:category
+ 数~段~先:subsequently
+ 不定:indeterminate
+ 冒頭:
+ 頭部:
+ 最終的:eventual
+ 一例:
+ ~~唯一の:sole
+ もっぱら:solely
+ 代わりに:instead
@@ -1286,6 +1501,7 @@
A.IntegerPart:#abstract-opdef-integerpart
A.ConvertToInt:#abstract-opdef-converttoint
+ A.json.stringify:~TC39#sec-json.stringify
引数をとらない:#dfn-xattr-no-arguments
@@ -1399,15 +1615,16 @@
~platform~obj:#dfn-platform-object
旧来の~platform~obj:#dfn-legacy-platform-object
+~JSON型:#dfn-json-types
+既定の~toJSON演算:#default-tojson-operation
+下層の値を取得-:#get-the-underlying-value
+対応する既定の演算:#corresponding-default-operation
+継承~stackを作成-:#create-an-inheritance-stack
+属性~値を収集-:#collect-attribute-values
+
読専:#dfn-read-only
正則~属性:#dfn-regular-attribute
正則~演算:#dfn-regular-operation
-直列化可能な型:#dfn-serializable-type
-直列化~pattern:#dfn-serialization-pattern
-直列化-時の挙動:#dfn-serialization-behavior
-直列形の値:#dfn-serialized-value
-直列形の値に変換-:#dfn-convert-to-serialized-value
-直列化子:#dfn-serializer
設定子:#dfn-setter
特殊~keyword:#dfn-special-keyword
特殊~演算:#dfn-special-operation
@@ -1559,7 +1776,6 @@
有名~prop設定子を呼出す:#dfn-invoke-named-setter
有名~構築子:#dfn-named-constructor
演算~関数を作成-:#dfn-create-operation-function
-seR.~JS値に変換-:#dfn-convert-serialized-value-to-ecmascript-value
配列~index~prop名:#dfn-array-index-property-name
利用者~objの属性~値を取得する:#get-a-user-objects-attribute-value
@@ -1575,13 +1791,17 @@
~list:~INFRA#list
付加-:~INFRA#list-append
~size:~INFRA#list-size
+空:~INFRA#list-is-empty
集合:~INFRA#ordered-set
set.付加-:~INFRA#set-append
+~stack:~INFRA#stack
+~pop:~INFRA#stack-pop
+~push:~INFRA#stack-push
~EACH:~INFRA#list-iterate
~EACH:~INFRA#map-iterate
←:~INFRA#map-set
-
+ ~set:~INFRA#map-set
大域~obj:~WAPI#concept-realm-global
関連する~Realm:~WAPI#concept-relevant-realm
@@ -1615,6 +1835,7 @@
#idl-objects:~ifcを実装している~obj
#idl-types:型
#idl-extended-attributes:拡張属性
+#idl-tojson-operation:~toJSON
#idl-special-operations:特殊~演算
#idl-stringifiers:文字列化子
#idl-indexed-properties:有index~prop
@@ -1638,7 +1859,6 @@
#es-constants:定数
#es-attributes:属性
#es-operations:演算
-#es-serializer:直列化子
#es-iterators:反復子に共通する挙動
#es-platform-objects:~ifcを実装している~platform~obj
#es-legacy-platform-objects:旧来の~platform~obj
@@ -1731,7 +1951,6 @@
"namespace"
"partial"
"required"
-"serializer"
"setlike"
"setter"
"static"
@@ -1764,7 +1983,6 @@
●InterfaceMember
Const
Operation
-Serializer
Stringifier
StaticMember
Iterable
@@ -1891,30 +2109,6 @@
ReturnType OperationRest
";"
-●Serializer
-"serializer" SerializerRest
-
-●SerializerRest
-OperationRest
-"=" SerializationPattern ";"
-";"
-
-●SerializationPattern
-"{" SerializationPatternMap "}"
-"[" SerializationPatternList "]"
-identifier
-
-●SerializationPatternMap
-"getter"
-"inherit" Identifiers
-identifier Identifiers
-ε
-
-●SerializationPatternList
-"getter"
-identifier Identifiers
-ε
-
●Identifiers
"," identifier Identifiers
ε
@@ -2542,7 +2736,7 @@
-更新: +更新: (公開: )
@@ -2566,7 +2760,7 @@+`識別子$ `toJSON^l は`予約済み識別子$ではないが、`idl-tojson-operation$secに述べるように,利用されるのは[ +~objを`~JSON型$に変換する`正則~演算$ +]に限られ~MUST。 +◎ +Although the “toJSON” identifier is not a reserved identifier, it must only be used for regular operations that convert objects to JSON types, as described in §2.2.3.1 toJSON. +
+ +注記: 後の節にて、一部の特定0の構成子に対しては,識別子の名前に更なる制約が課され得る。 ◎ @@ -3376,7 +3579,7 @@
-仕様~策定者は、既存の~APIの要件の記述に不可欠な場合を除き,単独の`演算$のみを持つ`呼戻~ifc$を定義するべきでない。 +仕様~策定者は、既存の~APIの要件の記述に~~不可欠な場合を除き,単独の`演算$のみを持つ`呼戻~ifc$を定義するべきでない。 代わりに,`呼戻~関数$が利用されるべきである。 ◎ Specification authors should not define callback interfaces that have only a single operation, unless required to describe the requirements of existing APIs. Instead, a callback function should be used. @@ -4132,6 +4335,32 @@
+所与の %~target 上で属性 %属性 の +`下層の値を取得-@ +するときは、次を走らす: +
+ +`属性$の`識別子$は[ @@ -4265,8 +4494,7 @@
-実装が -`利用者~obj$上の`属性$の値の取得-または設定-を試みたときに(例えば 呼戻~objが実装に供されているとき),その試みによる~~結果,例外が投出される場合、他から指定されない限り,その例外は[ +実装が`利用者~obj$上の`属性$の値を取得-または設定しようと試みたときに(例えば 呼戻~objが実装に供されているとき),その試みによる~~結果,例外が投出される場合、他から指定されない限り,その例外は[ 実装からその属性への~accessを生じさせた,利用者~code ]まで伝播することになる。 同様に、属性の取得-により返される値を~IDL型の値に変換できない場合、それにより生じた例外も[ @@ -4352,14 +4580,13 @@
演算には、次の拡張属性を適用できる: +`Default$x, `Exposed$x, `NewObject$x, `SecureContext$x, `Unforgeable$x ◎ -The following extended attributes are applicable to operations: [Exposed], [NewObject], [SecureContext], [Unforgeable]. +The following extended attributes are applicable to operations: [Default], [Exposed], [NewObject], [SecureContext], [Unforgeable].
+`~ifc$は、それを実装する~objを`~JSON型$に変換する方法を,~toJSON`正則~演算$を宣言することにより指定する。 +◎ +By declaring a toJSON regular operation, an interface specifies how to convert the objects that implement it to JSON types. +
+ ++~toJSON`正則~演算$は、この用法のために予約される。 +それは、 +0 個の引数をとり,`~JSON型$を返さ~MUST。 +◎ +The toJSON regular operation is reserved for this usage. It must take zero arguments and return a JSON type. +
+ ++次に挙げる型が +`~JSON型@ +とされる: +◎ +The JSON types are: +
+ ++言語束縛において~toJSON`正則~演算$を~obj上でどう可用にするか, および +`~JSON型$を~JSON文字列に正確にどう変換するかは、言語束縛~特有になる。 +◎ +How the toJSON regular operation is made available on an object in a language binding, and how exactly the JSON types are converted into a JSON string, is language binding specific. +
+ + +注記: +~JS言語束縛においては、これは,~toJSON~methを公開することにより行われる +— この~methは、`~JSON型$を[ +`json.stringify$A 関数により~JSON文字列に転換できるような,~JS値 +]に変換して返す。 +加えて,~JS言語束縛においては、~toJSON演算は `Default$x `拡張属性$をとれる +— その事例では、代わりに `既定の~toJSON演算$が公開される。 +◎ +Note: In the ECMAScript language binding, this is done by exposing a toJSON method which returns the JSON type converted into an ECMAScript value that can be turned into a JSON string by the JSON.stringify function. Additionaly, in the ECMAScript language binding, the toJSON operation can take a [Default] extended attribute, in which case the default toJSON operation is exposed instead. +
+ ++次の`~IDL片$は、~toJSON~methを持つような `Transaction^T ~ifcを定義する +— ~methは注釈文にて定義されることになる: +◎ +The following IDL fragment defines an interface Transaction that has a toJSON method defined in prose: +
+ + ++interface Transaction { + readonly attribute DOMString from; + readonly attribute DOMString to; + readonly attribute double amount; + readonly attribute DOMString description; + readonly attribute unsigned long number; + TransactionJSON toJSON(); +}; + +dictionary TransactionJSON { + Account from; + Account to; + double amount; + DOMString description; +};+ + +
+`Transaction^T `~ifc$の~toJSON`正則~演算$は、[ +被呼出時には次の手続きを走らす +]ように定義できる: +◎ +The toJSON regular operation of Transaction interface could be defined as follows: +◎ +To invoke the toJSON() operation of the Transaction interface, run the following steps: +
+ ++属性`識別子$の`~list$ « `from^l, `to^l, `amount^l, `description^l » 内の~EACH( %識別子 ) に対し: +◎ +For each attribute identifier attr in « "from", "to", "amount", "description" »: +
+ ++~JS言語束縛においては、 +`Transaction^T ~obj上に `toJSON()^c ~methが存在することになる: +◎ +In the ECMAScript language binding, there would exist a toJSON() method on Transaction objects: +
+ + +/* +`Transaction^T の~instanceを取得する +◎ +Get an instance of Transaction. + */ +var %txn = getTransaction(); + +/* +次の様な~objに評価される: +◎ +Evaluates to an object like this: + + { + from: "Bob", + to: "Alice", + amount: 50, + description: "books" + } +*/ +%txn.toJSON(); + +/* +次の様な文字列に評価される: +◎ +Evaluates to a string like this: + + '{"from":"Bob","to":"Alice","amount":50,"description":"books"}' +*/ +JSON.stringify(%txn); ++
-`特殊~演算$には、次の一覧に示す6種類がある。 +`特殊~演算$には、次の一覧に示す 5 種類がある。 一覧には、それぞれの種類の特殊~演算に対し,その宣言-時に利用される特殊~keyword, およびその特殊~演算の用途も示す: ◎ -There are six kinds of special operations. The table below indicates for a given kind of special operation what special keyword is used to declare it and what the purpose of the special operation is: +There are five kinds of special operations. The table below indicates for a given kind of special operation what special keyword is used to declare it and what the purpose of the special operation is:
`設定子@ | `setter^c |
@@ -4938,7 +5388,6 @@ 2.2.4. 特殊~演算◎ Defines behavior for when an object is indexed for property assignment or creation. - |
`削除子@ | `deleter^c |
@@ -4947,7 +5396,6 @@ 2.2.4. 特殊~演算◎ Defines behavior for when an object is indexed for property deletion. - |
`旧来呼出子@ | `legacycaller^c |
@@ -4955,7 +5403,6 @@ 2.2.4. 特殊~演算◎ Defines behavior for when an object is called as if it were a function. - |
`文字列化子@ | `stringifier^c |
@@ -4963,24 +5410,15 @@ 2.2.4. 特殊~演算◎ Defines how an object is converted into a DOMString. - - |
`直列化子@ - | `serializer^c - | -~objを直列化された形に変換する方法を定義する。 -◎ -Defines how an object is converted into a serialized form. - - - |
すべての言語束縛が、[ -これら6種類の,~objの特殊な挙動 +これら 5 種類の,~objの特殊な挙動 ]すべてを~supportするわけではない。 `特殊~演算$が,識別子を伴わない演算を利用して宣言された場合、その個々の種類の特殊~演算を~supportしない言語束縛においては,単にその機能性が存在しないことになる。 ◎ -Not all language bindings support all of the six kinds of special object behavior. When special operations are declared using operations with no identifier, then in language bindings that do not support the particular kind of special operations there simply will not be such functionality. +Not all language bindings support all of the five kinds of special object behavior. When special operations are declared using operations with no identifier, then in language bindings that do not support the particular kind of special operations there simply will not be such functionality.
所与の`~ifc$上に存在する,[ -`文字列化子$, `直列化子$, `削除子$ および, 各~系列の[ +`文字列化子$, `削除子$ および, 各~系列の[ `取得子$, `設定子$ ]]は、それぞれ,高々 1 個までで~MUST。 旧来呼出子については、多重定義された~callの挙動を指定する,複数のものが、同じ~ifc上に存在し得る。 ◎ -On a given interface, there must exist at most one stringifier, at most one serializer, at most one named property deleter, and at most one of each variety of getter and setter. Multiple legacy callers can exist on an interface to specify overloaded calling behavior. +On a given interface, there must exist at most one stringifier, at most one named property deleter, and at most one of each variety of getter and setter. Multiple legacy callers can exist on an interface to specify overloaded calling behavior.
@@ -5193,992 +5631,222 @@
-interface NumberQuadrupler {
- // この演算は単純に %x を 4 倍にして返す。
- legacycaller double compute(double %x);
-};
-
-
--この~ifcを~supportする~JS実装では,関数として~callされる `NumberQuadrupler^T を実装する`~platform~obj$が許容されることになるであろう: -◎ -An ECMAScript implementation supporting this interface would allow a platform object that implements NumberQuadrupler to be called as a function: -
- --var %f = getNumberQuadrupler(); // `NumberQuadrupler^T の~instanceを得る。 - -%f.compute(3); // これは `12^v に評価される。 -%f(3); // これも `12^v に評価される。 --
-`~ifc$が`文字列化子$を持つとき、 - -その~ifcを実装する~objは,文字列への既定でない変換を持つことになる。 -上で言及したように、文字列化子は -`stringifier^c ~keywordを伴って宣言される`演算$を利用して,指定できる。 -◎ -When an interface has a stringifier, it indicates that objects that implement the interface have a non-default conversion to a string. As mentioned above, stringifiers can be specified using an operation declared with the stringifier keyword. -
- --interface `interface_identifier^i { - stringifier DOMString `identifier^i(); - stringifier DOMString (); -}; -- -
-`文字列化子$の宣言-時に利用された演算が`識別子$を持たない場合、~ifcに付随する注釈文において,~ifcの -`文字列化の挙動@ -が定義され~MUST。 -演算が識別子を持つ場合、その演算の呼出しにより,~objは文字列に変換される。 -◎ -If an operation used to declare a stringifier does not have an identifier, then prose accompanying the interface must define the stringification behavior of the interface. If the operation does have an identifier, then the object is converted to a string by invoking the operation to obtain the string. -
- --演算により宣言される`文字列化子$は、引数をとらず, -`DOMString$T を返すように,宣言され~MUST。 -◎ -Stringifiers declared with operations must be declared to take zero arguments and return a DOMString. -
- --略記として、 -`stringifier^c ~keywordが,識別子を伴わない演算により宣言される場合、その演算の`返値型$, および引数~listを省略できる。 -◎ -As a shorthand, if the stringifier keyword is declared using an operation with no identifier, then the operation’s return type and argument list can be omitted. -
- --interface `interface_identifier^i { - stringifier; -}; -- -
-次の 2 つの~ifcは等価である: -◎ -The following two interfaces are equivalent: -
- --interface A { - stringifier DOMString (); -}; -- -
-interface A { - stringifier; -}; --
-`stringifier^c ~keywordは -`属性$上に置くこともできる。 -この場合、その属性の値が,~objから文字列への変換-を与える。 -`stringifier^c ~keywordが[[ -`DOMString$T/`USVString$T -として宣言されていない属性 -]や -`静的~属性$ -]上に置かれては~MUST_NOT。 -◎ -The stringifier keyword can also be placed on an attribute. In this case, the string to convert the object to is the value of the attribute. The stringifier keyword must not be placed on an attribute unless it is declared to be of type DOMString or USVString. It also must not be placed on a static attribute. -
- --interface `interface_identifier^i { - stringifier attribute DOMString `identifier^i; -}; -- -
-次の`~IDL片$は、 -`name^M -属性の値に文字列化する~ifcを定義する: -◎ -The following IDL fragment defines an interface that will stringify to the value of its name attribute: -
- --[Constructor] -interface Student { - attribute unsigned long id; - stringifier attribute DOMString name; -}; -- -
-~JS言語束縛においては、文字列が期待されている文脈において -`Student^T -~objが利用されたときの結果は、その~objの `name^l ~propの値になる: -◎ -In the ECMAScript binding, using a Student object in a context where a string is expected will result in the value of the object’s “name” property being used: -
- -
-var %s = new Student();
-%s.id = 12345678;
-%s.name = '周杰倫';
-
-var greeting = 'こんにちは、 ' + s + ' さん。';
- // %greeting は `こんにちは、 周杰倫 さん。^l になる。
-
-
--次の`~IDL片$は、~IDL自身には指定されない独自の文字列化の挙動を持つ~ifcを定義する。 -◎ -The following IDL fragment defines an interface that has custom stringification behavior that is not specified in the IDL itself. -
- --[Constructor] -interface Student { - attribute unsigned long id; - attribute DOMString? familyName; - attribute DOMString givenName; - - stringifier DOMString (); -}; -- -
-したがって、例えば次の段落の様な,文字列化の挙動を説明する注釈文が要求される: -◎ -Thus, prose is required to explain the stringification behavior, such as the following paragraph: -
- --`Student^T ~ifc を実装する~objを文字列化した結果は、 -`familyName^M 属性の値が `null^V の場合は -`givenName^M 属性の値,他の場合は[ -`givenName^M 属性の値, -1 個の space 文字, -`familyName^M 属性の値 -]の連結にならなければ~MUST_NOT。 -◎ -Objects that implement the Student interface must stringify as follows. If the value of the familyName attribute is null, the stringification of the object is the value of the givenName attribute. Otherwise, if the value of the familyName attribute is not null, the stringification of the object is the concatenation of the value of the givenName attribute, a single space character, and the value of the familyName attribute. -- -
-この~IDLの~JS実装は、次に従って挙動することになる: -◎ -An ECMAScript implementation of the IDL would behave as follows: -
- -
-var %s = new Student();
-%s.id = 12345679;
-%s.familyName = 'Smithee';
-%s.givenName = 'Alan';
-
-var %greeting = 'こんにちは、 ' + s + ' さん。';
- // %greeting は `こんにちは、 Alan Smithee さん^l になる。
-
--`~ifc$が`直列化子$を持つとき、その~ifcを実装する~objが,自身を直列化された形に変換する仕方を提供することを指示する。 -直列化子は `serializer^c ~keywordを利用して宣言できる。 -◎ -When an interface has a serializer, it indicates that objects provide a way for them to be converted into a serialized form. Serializers can be declared using the serializer keyword: -
- --interface `interface_identifier^i { - serializer; -}; -- -
-この仕方で`直列化子$を宣言する~ifcにおいては、付随する注釈文にて, -その~ifcの -`直列化-時の挙動@ -が定義され~MUST。 -直列化-時の挙動は、次のいずれかの型による -`直列形の値@ -を返すものとして定義される: -◎ -Prose accompanying an interface that declares a serializer in this way must define the serialization behavior of the interface. Serialization behavior is defined as returning a serialized value of one of the following types: -
- --次のいずれも満たすような,一連の~key-valueからなる~map -
--[ -言語束縛において,`直列化-時の挙動$が~obj上にて どう可用にされるか -], および[ -抽象的な`直列形の値$が どうやって適切な具体的な値に変換されるか -]については、言語束縛~特有になる。 -◎ -How the serialization behavior is made available on an object in a language binding, and how exactly the abstract serialized value is converted into an appropriate concrete value, is language binding specific. -
- -注記: -~JS言語束縛においては、`直列化-時の挙動$は,[ -`直列形の値$を[[ -`JSON.stringify^c 関数により JSON に直列化し得る -]ような~JS値 -]に変換したもの -]を返すような `toJSON^c ~methとして,公開される。 -詳細は、 -`es-serializer$sec -を見よ。 -◎ -Note: In the ECMAScript language binding, serialization behavior is exposed as a toJSON method which returns the serialized value converted into an ECMAScript value that can be serialized to JSON by the JSON.stringify function. See §3.6.8.2 Serializers for details. -
- --`直列化-時の挙動$は、別途の注釈文を与えずに,~IDLの中で直接的に指定することもできる。 -そのためには、 -~keyword `serializer^c と -文字 -`U+003D EQUALS SIGN ("=")^char -に続けて,以下に述べる6種の形をとり得る -`直列化~pattern@ -を記す: -◎ -Serialization behavior can also be specified directly in IDL, rather than separately as prose. This is done by following the serializer keyword with a U+003D EQUALS SIGN ("=") character and a serialization pattern, which can take one of the following six forms: -
- --interface `interface_identifier^i { - serializer = { `attribute_identifier^i, `attribute_identifier^i /* , ... */ }; // ① - serializer = { inherit, `attribute_identifier^i, `attribute_identifier^i /* , ... */ }; -}; -- -
-どの識別子も,~ifc上で宣言された属性の識別子で~MUST。 -識別されるどの属性も,`直列化可能な型$を持た~MUST。 -◎ -Each identifier must be the identifier of an attribute declared on the interface. The identified attributes all must have a serializable type. -
- --`inherit^c ~keywordを利用する~ifcは、次を満たしてい~MUST -⇒ -[ -`直列化子$を定義する別の~ifcを継承している -]~AND[ -そのような~ifcのうち最も末端のものは[ -この形, または次項の形(すなわち, `{ attribute }^c ) -]による`直列化~pattern$を利用して直列化子を定義している -] -◎ -The inherit keyword must not be used unless the interface inherits from another that defines a serializer, and the closest such interface defines its serializer using this serialization pattern form or the following form (i.e. { attribute }). -
- --この形の直列化~patternに対する`直列化-時の挙動$は、次で与えられる: -◎ -The serialization behavior for this form of serialization pattern is as follows: -
- --~FOR -直列化~pattern内の~EACH ( 属性~識別子 %i ) に対し,順に: -◎ -For each attribute identifier i in the serialization pattern, in order: -
- --interface `interface_identifier^i { - serializer = { attribute }; // ② - serializer = { inherit, attribute }; -}; -- -
-`inherit^c ~keywordを利用する~ifcは、次を満たしてい~MUST -⇒ -[ -`直列化子$を定義する別の~ifcを継承している -]~AND[ -そのような~ifcのうち最も末端のものは[ -この形, または前項の形 -]による`直列化~pattern$を利用して直列化子を定義している -] -◎ -The inherit keyword must not be used unless the interface inherits from another that defines a serializer, and the closest such interface defines its serializer using this serialization pattern form or the previous form. -
- - - --~FOR -~ifc上の ~EACH ( -`直列化可能な型$を持つ属性の識別子 %i -) に対し,それが~ifc上に現れる順に: -◎ -For each identifier i of an attribute on the interface whose type is a serializable type, in the order they appear on the interface: -
- --interface `interface_identifier^i { - serializer = { getter }; -}; -- -
-この形を利用する~ifcは、次を満たしてい~MUST -⇒ -[ -自身または継承している~ifcは,有名~propを~supportする -]~AND[ -その`有名~prop取得子$の返値型は直列化可能である -] -◎ -This form must not be used unless the interface or one it inherits from supports named properties and the return type of the named property getter is a serializable type. -
- - - --~FOR -~obj上の~EACH ( `被support~prop名$ %n ) に対し,順に: -◎ -For each supported property name n on the object, in order: -
- --interface `interface_identifier^i { - serializer = [ `attribute_identifier^i, `attribute_identifier^i /* , ... */ ]; -}; -- - - - - -
-~FOR -直列化~pattern内の ~EACH ( 属性~識別子 %i ) に対し,順に: -◎ -For each attribute identifier i in the serialization pattern: -
- --interface `interface_identifier^i { - serializer = [ getter ]; -}; -- -
-この形を利用する~ifcは、次を満たしてい~MUST -⇒ -[ -自身または継承している~ifcは,`有index~propを~support$する -]~AND[ -その`有index~prop取得子$の返値型は直列化可能である -] -◎ -This form must not be used unless the interface or one it inherits from supports indexed properties and the return type of the indexed property getter is a serializable type. -
- - - --~WHILE %i ~LTE ~obj上の`被support~prop~index$の最大: -◎ -While i is less than or equal to the greatest supported property index on the object: -
- --interface `interface_identifier^i { - serializer = `attribute_identifier^i; ++interface NumberQuadrupler { + // この演算は単純に %x を 4 倍にして返す。 + legacycaller double compute(double %x); };
-識別子は,~ifc上で宣言された属性の識別子で~MUST。 -その属性は,`直列化可能な型$を持た~MUST。 +この~ifcを~supportする~JS実装では,関数として~callされる `NumberQuadrupler^T を実装する`~platform~obj$が許容されることになるであろう: ◎ -The identifier must be the identifier of an attribute declared on the interface, and this attribute must have a serializable type. +An ECMAScript implementation supporting this interface would allow a platform object that implements NumberQuadrupler to be called as a function:
- - --
-- -~RET -指定された識別子を伴う属性の値を`直列形の値に変換-$した結果 -◎ -Let V be the value of the attribute with the specified identifier. -◎ -Return the result of converting V to a serialized value. -
-
+var %f = getNumberQuadrupler(); // `NumberQuadrupler^T の~instanceを得る。 +%f.compute(3); // これは `12^v に評価される。 +%f(3); // これも `12^v に評価される。 ++ +
注記: -一連の~entryは,特定0の順序により~mapに追加される。 -~JS言語束縛においては,~propが~objに追加される順序に従うものと定義される。 -この順序は -`JSON.stringify^c -から生成される直列化に波及するので。 +
+`~ifc$が`文字列化子$を持つとき、 + +その~ifcを実装する~objは,文字列への既定でない変換を持つことになる。 +上で言及したように、文字列化子は +`stringifier^c ~keywordを伴って宣言される`演算$を利用して,指定できる。 ◎ -Note: Entries are added to maps in a particular order so that in the ECMAScript language binding it is defined what order properties are added to objects. This is because this order can influence the serialization that JSON.stringify can produce. +When an interface has a stringifier, it indicates that objects that implement the interface have a non-default conversion to a string. As mentioned above, stringifiers can be specified using an operation declared with the stringifier keyword.
- - ++interface `interface_identifier^i { + stringifier DOMString `identifier^i(); + stringifier DOMString (); +}; +
-各種 -`直列化可能な型@, および -それらを -`直列形の値に変換-@ -する方法は、次で与えられる: +`文字列化子$の宣言-時に利用された演算が`識別子$を持たない場合、~ifcに付随する注釈文において,~ifcの +`文字列化の挙動@ +が定義され~MUST。 +演算が識別子を持つ場合、その演算の呼出しにより,~objは文字列に変換される。 ◎ -The list of serializable types and how they are converted to serialized values is as follows: +If an operation used to declare a stringifier does not have an identifier, then prose accompanying the interface must define the stringification behavior of the interface. If the operation does have an identifier, then the object is converted to a string by invoking the operation to obtain the string.
-+演算により宣言される`文字列化子$は、 +0 個の引数をとり `DOMString$T を返すように,宣言され~MUST。 ◎ -converted by invoking the object’s serializer -
-`直列化子$は `serializer^c ~keywordを伴う`演算$を利用して指定することもできる: +略記として、 +`stringifier^c ~keywordが,識別子を伴わない演算により宣言される場合、その演算の`返値型$, および引数~listを省略できる。 ◎ -Serializers can also be specified using an operation with the serializer keyword: +As a shorthand, if the stringifier keyword is declared using an operation with no identifier, then the operation’s return type and argument list can be omitted.
interface `interface_identifier^i { - serializer `identifier^i(); + stringifier; };+
-演算を伴って宣言される`直列化子$は、[ -0 個の引数をとる -~AND -`直列化可能な型$を返す -]ものとして,宣言され~MUST。 +次の 2 つの~ifcは等価である: ◎ -Serializers declared with operations must be declared to take zero arguments and return a serializable type. +The following two interfaces are equivalent:
++interface A { + stringifier DOMString (); +}; ++ +
+interface A { + stringifier; +}; ++
-`直列化子$が演算を伴って宣言されている~ifcにおける,`直列化-時の挙動$ -は、その演算を呼出して返される値を`直列形の値に変換-$した結果で与えられる。 +`stringifier^c ~keywordは +`属性$上に置くこともできる。 +この場合、その属性の値が,~objから文字列への変換-を与える。 +`stringifier^c ~keywordが[[ +`DOMString$T/`USVString$T +として宣言されていない属性 +]や +`静的~属性$ +]上に置かれては~MUST_NOT。 ◎ -The serialization behavior of the interface with a serializer declared with an operation is the result of converting the value returned from invoking the operation to a serialized value. +The stringifier keyword can also be placed on an attribute. In this case, the string to convert the object to is the value of the attribute. The stringifier keyword must not be placed on an attribute unless it is declared to be of type DOMString or USVString. It also must not be placed on a static attribute.
++interface `interface_identifier^i { + stringifier attribute DOMString `identifier^i; +}; ++
-次の -`~IDL片$は、注釈文にて定義される`直列化子$を持つ, `Transaction^T ~ifcを定義する: +次の`~IDL片$は、 +`name^M +属性の値に文字列化する~ifcを定義する: ◎ -The following IDL fragment defines an interface Transaction that has a serializer defines in prose: +The following IDL fragment defines an interface that will stringify to the value of its name attribute:
-interface Transaction { - readonly attribute Account from; - readonly attribute Account to; - readonly attribute double amount; - readonly attribute DOMString description; - readonly attribute unsigned long number; - - serializer; -}; - -interface Account { - attribute DOMString name; - attribute unsigned long number; +[Constructor] +interface Student { + attribute unsigned long id; + stringifier attribute DOMString name; };
-直列化子は、次に従うように定義できる: +~JS言語束縛においては、文字列が期待されている文脈において +`Student^T +~objが利用されたときの結果は、その~objの `name^l ~propの値になる: ◎ -The serializer could be defined as follows: +In the ECMAScript binding, using a Student object in a context where a string is expected will result in the value of the object’s “name” property being used:
---`Transaction^T ~ifcの`直列化-時の挙動$は、次の~algoで与えられる。 -ここで %O は `Transaction^T を実装する~objであるとする: -◎ -The serialization behavior of the Transaction interface is to run the following algorithm, where O is the object that implements Transaction: -
++var %s = new Student(); +%s.id = 12345678; +%s.name = '周杰倫'; -- -- -
- -[ -~key ~EQ `from^l, -~value ~EQ [ -%O 上の `from^M 属性から参照されている `Account^T ~obj上の `number^M 属性~値に対する`直列形の値$ -]]なる~entryを %map に追加する。 -◎ -Add an entry to map whose key is “from” and whose value is the serialized value of the number attribute on the Account object referenced by the from attribute on O. -
-- -[ -~key ~EQ `to^l, -~value ~EQ [ -%O 上の `to^M 属性から参照されている `Account^T ~obj上の `number^M 属性~値に対する`直列形の値$ -]]なる~entryを %map に追加する。 -◎ -Add an entry to map whose key is “to” and whose value is the serialized value of the number attribute on the Account object referenced by the to attribute on O. -
-- -属性 `amount^c, `description^c のそれぞれに対し,[ -~key ~EQ その属性の`識別子$, -~value ~EQ [ -%O 上のその属性~値に対する`直列形の値$ -]]なる~entryを %map に追加する。 -◎ -For both of the attributes amount and description, add an entry to map whose key is the identifier of the attribute and whose value is the serialized value of the value of the attribute on O. -
- +var greeting = 'こんにちは、 ' + s + ' さん。'; + // %greeting は `こんにちは、 周杰倫 さん。^l になる。 +
-`Account^T ~obj自身を直列化可能にしてもよいのであれば、`直列化~pattern$の利用により,注釈文による`直列化-時の挙動$を定義せずに済ませられるようになる: +次の`~IDL片$は、~IDL自身には指定されない独自の文字列化の挙動を持つ~ifcを定義する。 ◎ -If it was acceptable for Account objects to be serializable on their own, then serialization patterns could be used to avoid having to define the serialization behavior in prose: +The following IDL fragment defines an interface that has custom stringification behavior that is not specified in the IDL itself.
-interface Transaction { - readonly attribute Account from; - readonly attribute Account to; - readonly attribute double amount; - readonly attribute DOMString description; - readonly attribute unsigned long number; - - serializer = { from, to, amount, description }; -}; - -interface Account { - attribute DOMString name; - attribute unsigned long number; +[Constructor] +interface Student { + attribute unsigned long id; + attribute DOMString? familyName; + attribute DOMString givenName; - serializer = number; + stringifier DOMString (); };
-~JS言語束縛においては、 -`Transaction^T ~obj上に `toJSON^c ~methが存在することになる: +したがって、例えば次の段落の様な,文字列化の挙動を説明する注釈文が要求される: ◎ -In the ECMAScript language binding, there would exist a toJSON method on Transaction objects: +Thus, prose is required to explain the stringification behavior, such as the following paragraph:
--// `Transaction^T の~instanceを取得- -var %txn = getTransaction(); - ++`Student^T ~ifc を実装する~objを文字列化した結果は、 +`familyName^M 属性の値が `null^V の場合は +`givenName^M 属性の値,他の場合は[ +`givenName^M 属性の値, +1 個の space 文字, +`familyName^M 属性の値 +]の連結にならなければ~MUST_NOT。 +◎ +Objects that implement the Student interface must stringify as follows. If the value of the familyName attribute is null, the stringification of the object is the value of the givenName attribute. Otherwise, if the value of the familyName attribute is not null, the stringification of the object is the concatenation of the value of the givenName attribute, a single space character, and the value of the familyName attribute. +-/* 次の様な~objに評価される: - { - from: 1234 - to: 5678 - amount: 110.75 - description: "dinner" - } -*/ ++この~IDLの~JS実装は、次に従って挙動することになる: +◎ +An ECMAScript implementation of the IDL would behave as follows: +
-%txn.toJSON(); ++var %s = new Student(); +%s.id = 12345679; +%s.familyName = 'Smithee'; +%s.givenName = 'Alan'; -// 次の様な文字列に評価される: -// '{"from":1234,"to":5678,"amount":110.75,"description":"dinner"}' -JSON.stringify(%txn); +var %greeting = 'こんにちは、 ' + s + ' さん。'; + // %greeting は `こんにちは、 Alan Smithee さん^l になる。
`有index~prop取得子$を定義する`~ifc$は、 @@ -6457,7 +6125,7 @@
@@ -8857,7 +8525,7 @@
注記: -ここに挙げられていない~error名があれば、この仕様の冒頭に指示したように, ~bugを申請されるよう願う。 +ここに挙げられていない~error名があれば、この仕様の冒頭に指示したように, ~bugを~~提出されるよう願う。 間もなく解消に向けて取り組まれることになる。 Thanks! ◎ @@ -8940,7 +8608,7 @@
-`演算$の呼出しや`属性$に値を代入する際に必要になる,言語束縛~特有の型から~IDL型への変換はすべて、[ +`演算$の呼出しや`属性$に値を代入する際に必要になる,言語束縛に特有の型から~IDL型への変換はすべて、[ 演算に指定された機能性や 属性~代入 ]が~~実行に移される前に遂行される。 変換が遂行できない場合、演算は走らされず, 属性は更新されないことになる。 @@ -10181,8 +9849,7 @@
この仕様においては、 -`DOMString$T 値が妥当な UTF-16 文字列であることは要求されない。 +`DOMString$T 値が妥当な~UTF-16文字列であることは要求されない。 例えば, `DOMString$T 値は、対を成さない代用対( surrogate pair)文字も含み得る。 しかしながら,~Web~IDLを利用する仕様の策定者は、所与の個々の[ @@ -10516,8 +10183,8 @@
-`切離された$ `ArrayBuffer$T ~objに対し,~buffer~sourceに保持されている~byte列の`参照/複製を取得-$しようと試みたときは、言語束縛~特有の方式で失敗することになる。 +`切離された$ `ArrayBuffer$T ~objに対し,~buffer~sourceに保持されている~byte列の`参照/複製を取得-$しようと試みたときは、言語束縛に特有の方式で失敗することになる。 ◎ Attempting to get a reference to or get a copy of the bytes held by a buffer source when the ArrayBuffer has been detached will fail in a language binding-specific manner.
@@ -12014,15 +11681,8 @@-~recordが考慮に入れるのは, +~recordが考慮するのは, own enumerable ~propに限られるので、引数を返すだけの~IDL演算 @@ -15012,12 +14672,12 @@
@@ -15124,7 +14784,7 @@
-`AllowShared$x の利用に課される固有の要件については、 +`AllowShared$x の利用に課される特有の要件については、 `es-buffer-source-types$secの[ ~JS値から~IDL`~buffer~source型$へ変換する規則 ]を見よ。 @@ -15193,7 +14853,7 @@
-`Clamp$x の利用に課される固有の要件については、 +`Clamp$x の利用に課される特有の要件については、 `es-integer-types$secの[ ~JS値から種々の~IDL整数~型へ変換する規則 ]を見よ。 @@ -15357,7 +15017,7 @@
-var %x = new Circle();
+var %x = new Circle();
/*
+3.3.4. `Default^x
+
+
+`Default$x `拡張属性$が`正則~演算$上に現れた場合、[
+その演算が呼出されたときには,`対応する既定の演算$に述べられる手続きが行われ~MUST
+]ことを指示する。
+◎
+If the [Default] extended attribute appears on a regular operation, then it indicates that steps described in the corresponding default operation must be carried out when the operation is invoked.
+
+
+
+`Default$x 拡張属性は:
+◎
+↓
+
+
+ -
+`引数をとらない$ことが要求される。
+◎
+The [Default] extended attribute must take no arguments.
+
+ -
+次のもの以外に利用されては~MUST_NOT
+⇒
+`正則~演算$であって,`対応する既定の演算$が定義されているもの
+◎
+The [Default] extended attribute must not be used on anything other than a regular operation for which a corresponding default operation has been defined.
+
+
+
+
+
+
+例として、 `Default$x 拡張属性は,~toJSON`正則~演算$の利用に相応しくなる:
+◎
+As an example, the [Default] extended attribute is suitable for use on toJSON regular operations:
+
+
+
+
+interface Animal {
+ attribute DOMString name;
+ attribute unsigned short age;
+ [Default] object toJSON();
+};
+
+interface Human : Animal {
+ attribute Dog? pet;
+ [Default] object toJSON();
+};
+
+interface Dog : Animal {
+ attribute DOMString? breed;
+};
+
+
+
+~JS言語束縛においては、
+`toJSON()^c ~methは,
+`Animal^T, `Human^T
+~obj上に, および
+継承を介して `Dog^T ~obj上にも存在することになる:
+◎
+In the ECMAScript language binding, there would exist a toJSON() method on Animal, Human, and (via inheritance) Dog objects:
+
+
+
+/*
+`Human^T の~instanceを取得する
+◎
+Get an instance of Human.
+ */
+var %alice = getHuman();
+
+/*
+次の様な~objに評価される(この時点で, `Dog^T の~instanceは依然として `pet^l を保持することに注意):
+◎
+Evaluates to an object like this (notice how "pet" still holds an instance of Dog at this point):
+
+ {
+ name: "Alice",
+ age: 59,
+ pet: Dog
+ }
+*/
+%alice.toJSON();
+
+/*
+次の様な~objに評価される( `Dog^T ~ifcは既定の~toJSON演算を宣言していないので, `breed^l は不在になることに注意):
+◎
+Evaluates to an object like this (notice how "breed" is absent, as the Dog interface doesn’t declare a default toJSON operation):
+
+ {
+ name: "Tramp",
+ age: 6
+ }
+*/
+%alice.pet.toJSON();
+
+/*
+次の様な文字列に評価される:
+◎
+Evaluates to a string like this:
+
+ '{"name":"Alice","age":59,"pet":{"name":"Tramp","age":6}}'
+*/
+JSON.stringify(%alice);
+
+
+
+
@@ -15416,7 +15189,7 @@
-`EnforceRange$x の利用に課される固有の要件については、 +`EnforceRange$x の利用に課される特有の要件については、 `es-type-mapping$secの[ ~JS値から種々の~IDL整数~型へ変換する規則 ]を見よ。 @@ -15478,7 +15251,7 @@
`Exposed$x `拡張属性$が[ @@ -15648,7 +15421,7 @@
注記: -~JS大域~objに`関連する設定群~obj$が`保安的~文脈$であるかどうかは,変化し得ないので、 -%X に対する~propを作成するかどうかの実装による決断は、`初期~obj$を作成する時点の一度限りになる。 +~JS大域~objに`関連する設定群~obj$が`保安的~文脈$であるかどうかは,変化し得ないので、実装が %X に対する~propを作成するかどうか決めるのは、`初期~obj$を作成する時点の一度限りになる。 ◎ Note: Since it is not possible for the relevant settings object for an ECMAScript global object to change whether it is a secure context or not over time, an implementation’s decision to create properties for an interface or interface member can be made once, at the time the initial objects are created.
-`Exposed$x の利用に課される固有の要件については、 +`Exposed$x の利用に課される特有の要件については、 `es-interfaces$sec, `es-constants$sec, `es-attributes$sec, @@ -15792,7 +15564,7 @@
[ @@ -15918,13 +15690,12 @@
注記: @@ -15980,7 +15751,7 @@
有名~propにおける `Global$x / `PrimaryGlobal$x -の利用に課される固有の要件については、 +の利用に課される特有の要件については、 `named-properties-object$sec を見よ。 `~ifc~mb$に対応する~propの所在に関する要件については、 @@ -16071,7 +15842,7 @@
`LegacyArrayClass$x `拡張属性$が[ @@ -16109,7 +15880,7 @@
-`LegacyArrayClass$x の利用に課される固有の要件については、 +`LegacyArrayClass$x の利用に課される特有の要件については、 `interface-prototype-object$sec を見よ。 ◎ @@ -16179,7 +15950,7 @@
`LegacyUnenumerableNamedProperties$x `拡張属性$が[ @@ -16206,7 +15977,7 @@
-`LegacyUnenumerableNamedProperties$x の利用に課される固有の要件については、 +`LegacyUnenumerableNamedProperties$x の利用に課される特有の要件については、 `legacy-platform-object-property-enumeration$sec を見よ。 ◎ @@ -16217,7 +15988,7 @@
`LegacyWindowAlias$x `拡張属性$が `~ifc$ %I 上に現れた場合、[ @@ -16341,7 +16112,7 @@
`LenientSetter$x `拡張属性$が[ @@ -16446,7 +16217,7 @@
`LenientThis$x `拡張属性$が `正則~属性$上に現れた場合、その属性が現れる`~ifc$を実装する~objとは異なる `this^v 値を伴うような,その属性の取得子や設定子の呼出は、無視されることになる。 @@ -16539,7 +16310,7 @@
`NewObject$x `拡張属性$が[ @@ -16724,7 +16495,7 @@
@@ -16776,7 +16547,7 @@
-`NoInterfaceObject$x の利用に課される固有の要件については、 +`NoInterfaceObject$x の利用に課される特有の要件については、 `es-interfaces$sec を見よ。 ◎ @@ -16834,7 +16605,7 @@
@@ -16868,7 +16639,7 @@
-`OverrideBuiltins$x の利用に課される固有の要件については、 +`OverrideBuiltins$x の利用に課される特有の要件については、 `es-legacy-platform-objects$sec, `legacy-platform-object-defineownproperty$sec を見よ。 @@ -16957,13 +16728,13 @@
`PutForwards$x `拡張属性$が[ `~ifc型$の`読専$の`正則~属性$宣言 -]上に現れた場合、その属性への代入ingは 固有の挙動を持つことになる。 +]上に現れた場合、その属性への代入ingは 特有の挙動を持つことになる。 すなわち,その代入は、代入-が試みられた属性から,現在~参照されている~objの属性(その拡張属性の引数で指定される)に “転送-” される。 ◎ If the [PutForwards] extended attribute appears on a read only regular attribute declaration whose type is an interface type, it indicates that assigning to the attribute will have specific behavior. Namely, the assignment is “forwarded” to the attribute (specified by the extended attribute argument) on the object that is currently referenced by the attribute being assigned to. @@ -17109,7 +16880,7 @@
@@ -17156,7 +16927,7 @@
-`Replaceable$x の利用に課される固有の要件については、 +`Replaceable$x の利用に課される特有の要件については、 `es-attributes$sec を見よ。 ◎ @@ -17204,8 +16975,7 @@
@@ -17279,7 +17049,7 @@
`SecureContext$x `拡張属性$が[ @@ -17454,7 +17224,7 @@
@@ -17479,7 +17249,7 @@
-`TreatNonObjectAsNull$x の利用に課される固有の要件については、 +`TreatNonObjectAsNull$x の利用に課される特有の要件については、 `es-nullable-type$sec を見よ。 ◎ @@ -17545,7 +17315,7 @@
`TreatNullAs$x `拡張属性$が `DOMString$T 型に現れた場合、次に従ってふるまう,新たな型を作成する @@ -17578,7 +17348,7 @@
-`TreatNullAs$x の利用に課される固有の要件については、 +`TreatNullAs$x の利用に課される特有の要件については、 `es-DOMString$sec を見よ。 ◎ @@ -17635,7 +17405,7 @@
@@ -17732,7 +17502,7 @@
-`Unforgeable$x の利用に課される固有の要件については、 +`Unforgeable$x の利用に課される特有の要件については、 `es-attributes$sec, `es-operations$sec, `es-platform-objects$sec, @@ -17798,7 +17568,7 @@
`Unscopable$x `拡張属性$が[ @@ -17848,7 +17618,7 @@
-`Unscopable$x の利用に課される固有の要件については、 +`Unscopable$x の利用に課される特有の要件については、 `interface-prototype-object$sec を見よ。 ◎ @@ -18056,7 +17826,7 @@
-まず、関数に渡された~JS引数の個数を考慮に入れつつ,妥当な多重定義の選定が行われる: +まず、関数に渡された~JS引数の個数を考慮しつつ,妥当な多重定義の選定が行われる: ◎ First, the selection of valid overloads is done by considering the number of ECMAScript arguments that were passed in to the function:
@@ -18663,7 +18433,7 @@-%R ~LET -( %operation, %values ) を引数に,演算の記述に挙げられている手続きを +~ELSE : +◎ +Otherwise: +
+上で例外 %e が投出された場合の手続き: ◎ @@ -20484,19 +20274,351 @@
+`Default$x `拡張属性$を宣言してよい`正則~演算$は、下に定義される +`対応する既定の演算@ +持つものに限られる。 +`現時点では、~toJSONしかない。^tnote +◎ +Only regular operations which have a corresponding default operation defined below may be declared with a [Default] extended attribute. +
+ ++~toJSON演算に`対応する既定の演算$は、`既定の~toJSON演算$で与えられる。 +◎ +The corresponding default operation of the toJSON operation is the default toJSON operation. +
+ ++`既定の~toJSON演算$の`返値型$は、 +`object$T で~MUST。 +◎ +The return type of the default toJSON operation must be object. +
+ ++`~ifc$ %I の +`既定の~toJSON演算@ +を %O 上で呼出すときは、次の手続きを走らす: +◎ +To invoke the default toJSON operation of interface I on O, run the the following steps: +
+ ++%~map 内の~EACH( %key → %value ) に対し: +◎ +For each key → value of map, +
++%O 上の +`属性~値を収集-@ +する抽象~演算は、所与の +( `~stack$ %~stack, `有順序~map$ %~map ) +に対し,次を走らす: +◎ +To invoke the collect attribute values abstract operation on O with stack stack and ordered map map as arguments, run the the following steps: +
+ ++~IF[ +%I 上に[ +`Default$x `拡張属性$を伴う~toJSON演算 +]は宣言されている +] +⇒ +%I 上に`公開され$ている`~ifc~mb$のうち,`正則~属性$である ~EACH( %属性 ) に対し: +◎ +If a toJSON operation with a [Default] extended attribute is declared on I, then for each exposed regular attribute attr that is an interface member of I, in order: +
++[ +左側の`識別子$は %I を参照する +]ような ~EACH( `~implements文$ %文 ) に対し: +◎ +For each implements statements where the left-hand side identifier references I: +
++`~ifc$ %I に対する +`継承~stackを作成-@ +するときは、次を走らす: +◎ +To create an inheritance stack for interface I, run the the following steps: +
+ ++下に与える`~IDL片$は、`~ifc$ `A^T の[ +`被継承~ifc$/`広義~帰結~ifc$ +]を成す,いくつかの`~ifc$を定義する +— 次の継承~木に示されるような: +◎ +The following IDL fragment defines a number of interfaces which are inherited or consequential interfaces of A, as show in the below inheritance tree. +
+ + ++ F* + | + C E - I* + | | + B* - D* + | +G* - A - H* ++ +
+`*^c が付与されている~ifcは、 +`Default$x `拡張属性$を伴う~toJSON`演算$を宣言する。 +◎ +Interfaces markes with an asterisk ("*") declare a toJSON operation with a [Default] extended attribute. +
+ + ++interface A : B { + attribute DOMString a; +}; + +interface B : C { + [Default] object toJSON(); + attribute DOMString b; +}; + +interface C { + attribute DOMString c; +}; + +interface D : E { + [Default] object toJSON(); + attribute DOMString d; +}; + +interface E : F { + attribute DOMString e; +}; + +interface F { + [Default] object toJSON(); + attribute DOMString f; +}; + +interface G { + [Default] object toJSON(); + attribute DOMString g; +}; + +interface H { + [Default] object toJSON(); + attribute DOMString h; +}; + +interface I { + [Default] object toJSON(); + attribute DOMString i; +}; + +A implements G; +A implements H; +B implements D; +E implements I; ++ +
+上に定義した~ifc `A^T を実装している~obj上で `toJSON()^c を~methを~callした場合、次のような~JSON~objを返すことになる: +◎ +Calling the toJSON() method of an object implementing interface A defined above would return the following JSON object: +
+ + ++{ + "b": "...", + "f": "...", + "i": "...", + "d": "...", + "g": "...", + "h": "..." +} ++ +
+~ifc `B^T を実装している~objでは、次のような~JSON~objを返すことになる: ◎ -Return F. - - +An object implementing interface B would return: +
+ + ++{ + "b": "...", + "f": "...", + "i": "...", + "d": "..." +} ++
`~ifc$が`公開され$ている`文字列化子$(以下 %文字列化子 と記す)を持つ場合、次の特徴を有する~propが存在し~MUST: @@ -20542,7 +20664,7 @@
-`公開され$ている`直列化子$(以下 %直列化子 と記す)を持つ`~ifc$に対しては、次の特徴を有する~propが存在し~MUST: -
- --~propは ~ifcに対する`通例の場所に存在する$。 -◎ -The location of the property is determined as follows: -• If the interface was declared with the [Global] or [PrimaryGlobal] extended attribute, then the property exists on the single object that implements the interface. -• Otherwise, if the interface is a consequential interface of a [Global]- or [PrimaryGlobal]-annotated interface, then the property exists on the single object that implements the [Global]- or [PrimaryGlobal]-annotated interface as well as on the consequential interface’s interface prototype object. -• Otherwise, the property exists solely on the interface’s interface prototype object. -
- --~prop値 %F は、被呼出時には次に従って挙動し~MUST: -◎ -The property’s Function object, when invoked, must behave as follows: -
- --%直列化子 の `serializer^c の指定のされ方に応じて: -◎ -Depending on how serializer was specified: -
- --この `Function^t ~objの `name^l ~propの値は、 -`String^t 値 `toJSON^l である。 -◎ -The value of the Function object’s “name” property is the String value “toJSON”. -
- --直列形の値から -`~JS値に変換-@seR -する手続きは,次で定義される: -◎ -The following steps define how to convert a serialized value to an ECMAScript value: -
- --%S の型に応じて: -◎ -Depending on the type of S: -
- --~FOR -%S 内の~EACH ( ~entry ) に対し,それらが~mapに追加された順に: -◎ -For each entry in S, in the order they were added to the map: -
- --~WHILE %index ~LT %S 内の要素~数: -◎ -While index is less than the number of elements in S: -
- -+~propは ~ifcに対する`通例の場所に存在する$。 +◎ +The location of the property is determined as follows: +• If the interface was declared with the [Global] or [PrimaryGlobal] extended attribute, then the property exists on the single object that implements the interface. +• Otherwise, if the interface is a consequential interface of a [Global]- or [PrimaryGlobal]-annotated interface, then the property exists on the single object that implements the [Global]- or [PrimaryGlobal]-annotated interface as well as on the consequential interface’s interface prototype object. +• Otherwise, the property exists solely on the interface’s interface prototype object. +
~prop値 %F は、次で与えられる: @@ -21148,7 +21030,9 @@
~IF[ -%operation は `識別子$を伴わずに定義されている +%演算 は `識別子$を伴わずに定義されている ]: ◎ If operation was defined without an identifier, then: @@ -23363,13 +23247,13 @@
言語束縛の要件に対する拡張は、この文書~内で定義される拡張属性と競合しない`拡張属性$を利用して指定できる。 [ -私的な~project特有の利用 +私的な~projectに特有の利用 ]のための拡張は、他の仕様に現れる`~IDL片$に含められるべきではない。 他の仕様の用途に要求される拡張は、この文書の将来~versionに取り込まれるためには, Web IDL の担当グループ(この文書が書かれた時点では @@ -25696,7 +25580,7 @@
~IDL構文においては、文字の大小は,文法~内で利用される引用符で括られた終端~記号と -`identifier$g 終端~記号に利用される値の,いずれにおいても区別される。 +`identifier$g 終端~記号に利用される値の,いずれにおいても~~区別される。 したがって、例えば入力~text “Const” は,終端~記号 `const^sym ではなく `identifier$g として~tok化され、 @@ -25892,7 +25776,7 @@
-規定でない注記: +規範的でない注記: ◎ Non-normative notes:
@@ -25905,7 +25789,7 @@-規定でない例: +規範的でない例: ◎ Non-normative examples:
@@ -25920,7 +25804,7 @@-規定の警告: +規範的な警告: ◎ Normative warnings:
@@ -26005,7 +25889,7 @@-この仕様では、次に挙げる主体が適合性の対象になるものと定義される: +この仕様では、次に挙げるものが適合性クラスとして定義される: ◎ The following conformance classes are defined by this specification:
@@ -26099,237 +25983,21 @@