Skip to content

Commit

Permalink
Meta: export record and sequence (#243)
Browse files Browse the repository at this point in the history
Also stop marking them up as Bikeshed IDL types since they’re not.

See also #233 and #240 (although this commit doesn't address them fully).
  • Loading branch information
annevk authored and tobie committed Nov 22, 2016
1 parent a0b2c0c commit d99fdf9
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 48 deletions.
24 changes: 12 additions & 12 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3277,7 +3277,7 @@ the following algorithm returns <i>true</i>.
<ul>
<li>
<code>{{double}}?</code> and
<code>{{record}}&lt;{{DOMString}}, {{DOMString}}></code>
<code>[=record=]&lt;{{DOMString}}, {{DOMString}}></code>
</li>
<li>
<code>(Interface1 or {{long}})?</code> and
Expand Down Expand Up @@ -5785,9 +5785,9 @@ the string “OrNull”.
</div>


<h4 oldids="dom-sequence" id="idl-sequence" interface lt="sequence|sequence&lt;T&gt;">Sequence types — sequence&lt;|T|&gt;</h4>
<h4 oldids="dom-sequence" id="idl-sequence" lt="sequence|sequence&lt;T&gt;" dfn export>Sequence types — sequence&lt;|T|&gt;</h4>

The <dfn lt="sequence type" expose>sequence&lt;|T|&gt;</dfn>
The <dfn lt="sequence type" export>sequence&lt;|T|&gt;</dfn>
type is a parameterized type whose values are (possibly zero-length) sequences of
values of type |T|.

Expand Down Expand Up @@ -5816,7 +5816,7 @@ is the concatenation of the type name for |T| and
the string “Sequence”.


<h4 id="idl-record" dictionary lt="record">Record types — record&lt;|K|, |V|&gt;</h4>
<h4 id="idl-record" lt="record" dfn export>Record types — record&lt;|K|, |V|&gt;</h4>

A <dfn export>record type</dfn> is a parameterized type
whose values are ordered associative arrays mapping instances of |K| to
Expand Down Expand Up @@ -7438,15 +7438,15 @@ ECMAScript <emu-val>Array</emu-val> values.

<h4 id="es-record">Records — record&lt;|K|, |V|&gt;</h4>

IDL {{record}}&lt;|K|, |V|&gt; values are represented by
IDL [=record=]&lt;|K|, |V|&gt; values are represented by
ECMAScript <emu-val>Object</emu-val> values.

<div id="es-to-record" algorithm="convert an ECMAScript value to record">

An ECMAScript value |O| is [=converted to an IDL value|converted=]
to an IDL <code>{{record}}&lt;|K|, |V|></code> value as follows:
to an IDL <code>[=record=]&lt;|K|, |V|></code> value as follows:

1. Let |result| be a new empty instance of <code>{{record}}&lt;|K|, |V|></code>.
1. Let |result| be a new empty instance of <code>[=record=]&lt;|K|, |V|></code>.
1. If [=Type=](|O|) is Undefined or Null,
return |result|.
1. If [=Type=](|O|) is not Object,
Expand All @@ -7468,7 +7468,7 @@ ECMAScript <emu-val>Object</emu-val> values.

<div id="record-to-es" algorithm="convert a record to an ECMAScript value">

An IDL <code>{{record}}&lt;…></code> value |D| is
An IDL <code>[=record=]&lt;…></code> value |D| is
[=converted to an ECMAScript value|converted=]
to an ECMAScript value as follows:

Expand All @@ -7484,7 +7484,7 @@ ECMAScript <emu-val>Object</emu-val> values.
<div class="example" id="example-es-record">

Passing the ECMAScript value <code>{b: 3, a: 4}</code> as a
<code>{{record}}&lt;DOMString, double></code> argument
<code>[=record=]&lt;DOMString, double></code> argument
would result in the IDL value « ("b", 3), ("a", 4) ».

Records only consider [=own property|own=] [=enumerable=]
Expand Down Expand Up @@ -7515,17 +7515,17 @@ ECMAScript <emu-val>Object</emu-val> values.
<thead><th>Value</th><th>Passed to type</th><th>Result</th></thead>
<tr>
<td><code>{"😞": 1}</code></td>
<td><code>{{record}}&lt;ByteString, double></code></td>
<td><code>[=record=]&lt;ByteString, double></code></td>
<td><emu-val>TypeError</emu-val></td>
</tr>
<tr>
<td><code>{"\uD83D": 1}</code></td>
<td><code>{{record}}&lt;USVString, double></code></td>
<td><code>[=record=]&lt;USVString, double></code></td>
<td>« ("\uFFFD", 1) »</td>
</tr>
<tr>
<td><code>{"\uD83D": {hello: "world"}}</code></td>
<td><code>{{record}}&lt;DOMString, double></code></td>
<td><code>[=record=]&lt;DOMString, double></code></td>
<td>« ("\uD83D", 0) »</td>
</tr>
</table>
Expand Down
Loading

0 comments on commit d99fdf9

Please sign in to comment.