Skip to content

Commit

Permalink
Editorial: use Type(x) were appropriate.
Browse files Browse the repository at this point in the history
Fixes whatwg#222.
  • Loading branch information
tobie committed Jan 20, 2017
1 parent 0b1a510 commit de62851
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 40 deletions.
45 changes: 21 additions & 24 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -7641,8 +7641,7 @@ that correspond to the union’s [=member types=].
then return the IDL value <emu-val>null</emu-val>.
1. Let |types| be the [=flattened member types=]
of the [=union type=].
1. If |V| is <emu-val>null</emu-val> or
<emu-val>undefined</emu-val>, then:
1. If |V| is <emu-val>null</emu-val> or <emu-val>undefined</emu-val>, then:
1. If |types| includes a [=dictionary type=], then return the
result of [=converted to an IDL value|converting=] |V| to that dictionary type.
1. If |types| includes a [=record type=], then return the
Expand All @@ -7659,25 +7658,25 @@ that correspond to the union’s [=member types=].
|V| to that type.
1. If |types| includes {{object}}, then return the IDL value
that is a reference to the object |V|.
1. If |V| is a native <emu-val>Error</emu-val> object (that is, it has an \[[ErrorData]] [=internal slot=]), then:
1. If [=Type=](|V|) is Object and |V| has an \[[ErrorData]] [=internal slot=]), then:
1. If |types| includes {{Error!!interface}}, then return the
result of [=converted to an IDL value|converting=]
|V| to {{Error!!interface}}.
1. If |types| includes {{object}}, then return the IDL value
that is a reference to the object |V|.
1. If |V| is an object with an \[[ArrayBufferData]] [=internal slot=], then:
1. If [=Type=](|V|) is Object and |V| has an \[[ArrayBufferData]] [=internal slot=], then:
1. If |types| includes {{ArrayBuffer}}, then return the
result of [=converted to an IDL value|converting=]
|V| to {{ArrayBuffer}}.
1. If |types| includes {{object}}, then return the IDL value
that is a reference to the object |V|.
1. If |V| is an object with a \[[DataView]] [=internal slot=], then:
1. If [=Type=](|V|) is Object and |V| has a \[[DataView]] [=internal slot=], then:
1. If |types| includes {{DataView}}, then return the
result of [=converted to an IDL value|converting=]
|V| to {{DataView}}.
1. If |types| includes {{object}}, then return the IDL value
that is a reference to the object |V|.
1. If |V| is an object with a \[[TypedArrayName]] [=internal slot=], then:
1. If [=Type=](|V|) is Object and |V| has a \[[TypedArrayName]] [=internal slot=], then:
1. If |types| includes a [=typed array type=]
whose name is the value of |V|’s \[[TypedArrayName]] [=internal slot=], then return the
result of [=converted to an IDL value|converting=]
Expand All @@ -7691,24 +7690,22 @@ that correspond to the union’s [=member types=].
|V| to that callback function type.
1. If |types| includes {{object}}, then return the IDL value
that is a reference to the object |V|.
1. If |V| is any kind of object, then:
1. If [=Type=](|V|) is Object, then:
1. If |types| includes a [=sequence type=], then
1. Let |method| be the result of
[=GetMethod=](|V|, [=@@iterator=]).
1. [=ReturnIfAbrupt=](|method|).
1. If |method| is not
<emu-val>undefined</emu-val>,
1. If |method| is not <emu-val>undefined</emu-val>,
return the result of
[=creating a sequence from an iterable|creating a sequence=]
of that type from |V| and |method|.
1. If |types| includes a [=frozen array type=], then
1. Let |method| be the result of
[=GetMethod=](|V|, [=@@iterator=]).
1. Let |method| be the result of [=GetMethod=](|V|, [=@@iterator=]).
1. [=ReturnIfAbrupt=](|method|).
1. If |method| is not
<emu-val>undefined</emu-val>,
1. If |method| is not <emu-val>undefined</emu-val>,
return the result of
[=Creating a frozen array from an iterable|creating a frozen array of that type from V and method=].
[=Creating a frozen array from an iterable|creating a frozen array=]
of that type from |V| and |method|.
1. If |types| includes a [=dictionary type=], then return the
result of [=converted to an IDL value|converting=]
|V| to that dictionary type.
Expand All @@ -7721,11 +7718,11 @@ that correspond to the union’s [=member types=].
|V| to that interface type.
1. If |types| includes {{object}}, then return the IDL value
that is a reference to the object |V|.
1. If |V| is a <emu-val>Boolean</emu-val> value, then:
1. If [=Type=](|V|) is Boolean, then:
1. If |types| includes a {{boolean}},
then return the result of [=converted to an IDL value|converting=]
|V| to {{boolean}}.
1. If |V| is a <emu-val>Number</emu-val> value, then:
1. If [=Type=](|V|) is Number, then:
1. If |types| includes a [=numeric type=],
then return the result of [=converted to an IDL value|converting=]
|V| to that [=numeric type=].
Expand Down Expand Up @@ -9802,7 +9799,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]

then remove from |S| all other entries.

1. Otherwise: if |V| is an <emu-val>Error</emu-val> object (that is, it has an \[[ErrorData]] [=internal slot=]) and
1. Otherwise: if [=Type=](|V|) is Object, |V| has an \[[ErrorData]] [=internal slot=], and
there is an entry in |S| that has one of the following types at position |i| of its type list,
* {{Error!!interface}}
* {{object}}
Expand All @@ -9812,7 +9809,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]

then remove from |S| all other entries.

1. Otherwise: if |V| is an object with an \[[ArrayBufferData]] [=internal slot=] and
1. Otherwise: if [=Type=](|V|) is Object, |V| has an \[[ArrayBufferData]] [=internal slot=], and
there is an entry in |S| that has one of the following types at position |i| of its type list,
* {{ArrayBuffer}}
* {{object}}
Expand All @@ -9822,7 +9819,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]

then remove from |S| all other entries.

1. Otherwise: if |V| is an object with a \[[DataView]] [=internal slot=] and
1. Otherwise: if [=Type=](|V|) is Object, |V| has a \[[DataView]] [=internal slot=], and
there is an entry in |S| that has one of the following types at position |i| of its type list,
* {{DataView}}
* {{object}}
Expand All @@ -9832,7 +9829,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]

then remove from |S| all other entries.

1. Otherwise: if |V| is an object with a \[[TypedArrayName]] [=internal slot=] and
1. Otherwise: if [=Type=](|V|) is Object, |V| has a \[[TypedArrayName]] [=internal slot=], and
there is an entry in |S| that has one of the following types at position |i| of its type list,
* a [=typed array type=] whose name
is equal to the value of |V|’s \[[TypedArrayName]] [=internal slot=]
Expand All @@ -9853,7 +9850,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]

then remove from |S| all other entries.

1. Otherwise: if |V| is any kind of object, and
1. Otherwise: if [=Type=](|V|) is Object and
there is an entry in |S| that has one of the
following types at position |i| of its type list,
* a [=sequence type=]
Expand All @@ -9871,7 +9868,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]
|method| is not <emu-val>undefined</emu-val>, then remove from |S| all
other entries.

1. Otherwise: if |V| is any kind of object, and
1. Otherwise: if [=Type=](|V|) is Object and
there is an entry in |S| that has one of the following types at position |i| of its type list,
* a [=callback interface=] type
* a [=dictionary type=]
Expand All @@ -9883,7 +9880,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]

then remove from |S| all other entries.

1. Otherwise: if |V| is a <emu-val>Boolean</emu-val> value,
1. Otherwise: if [=Type=](|V|) is Boolean
and there is an entry in |S| that has one of the following types at position |i| of its type list,
* {{boolean}}
* a [=nullable type|nullable=] {{boolean}}
Expand All @@ -9892,7 +9889,7 @@ Note: The HTML Standard defines how a security check is performed. [[!HTML]]

then remove from |S| all other entries.

1. Otherwise: if |V| is a <emu-val>Number</emu-val> value,
1. Otherwise: if [=Type=](|V|) is Number
and there is an entry in |S| that has one of the following types at position |i| of its type list,
* a [=numeric type=]
* a [=nullable type|nullable=] [=numeric type=]
Expand Down

0 comments on commit de62851

Please sign in to comment.