Skip to content

Commit 3a3508c

Browse files
authored
Markup: Eliminate usage of <emu-normative-optional> (#999)
1 parent aaa71ce commit 3a3508c

File tree

3 files changed

+72
-95
lines changed

3 files changed

+72
-95
lines changed

spec/datetimeformat.html

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,23 @@ <h1>Intl.DateTimeFormat ( [ _locales_ [ , _options_ ] ] )</h1>
2020
1. Return _dateTimeFormat_.
2121
</emu-alg>
2222

23-
<emu-normative-optional>
24-
25-
<emu-clause id="sec-chaindatetimeformat" type="abstract operation">
26-
<h1>
27-
ChainDateTimeFormat (
28-
_dateTimeFormat_: an Intl.DateTimeFormat,
29-
_newTarget_: an ECMAScript language value,
30-
_this_: an ECMAScript language value,
31-
): either a normal completion containing an Object or a throw completion
32-
</h1>
33-
<dl class="header">
34-
</dl>
35-
<emu-alg>
36-
1. If _newTarget_ is *undefined* and ? OrdinaryHasInstance(%Intl.DateTimeFormat%, _this_) is *true*, then
37-
1. Perform ? DefinePropertyOrThrow(_this_, %Intl%.[[FallbackSymbol]], PropertyDescriptor{ [[Value]]: _dateTimeFormat_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }).
38-
1. Return _this_.
39-
1. Return _dateTimeFormat_.
40-
</emu-alg>
41-
</emu-clause>
42-
</emu-normative-optional>
23+
<emu-clause id="sec-chaindatetimeformat" type="abstract operation" normative-optional>
24+
<h1>
25+
ChainDateTimeFormat (
26+
_dateTimeFormat_: an Intl.DateTimeFormat,
27+
_newTarget_: an ECMAScript language value,
28+
_this_: an ECMAScript language value,
29+
): either a normal completion containing an Object or a throw completion
30+
</h1>
31+
<dl class="header">
32+
</dl>
33+
<emu-alg>
34+
1. If _newTarget_ is *undefined* and ? OrdinaryHasInstance(%Intl.DateTimeFormat%, _this_) is *true*, then
35+
1. Perform ? DefinePropertyOrThrow(_this_, %Intl%.[[FallbackSymbol]], PropertyDescriptor{ [[Value]]: _dateTimeFormat_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }).
36+
1. Return _this_.
37+
1. Return _dateTimeFormat_.
38+
</emu-alg>
39+
</emu-clause>
4340
</emu-clause>
4441

4542
<emu-clause id="sec-createdatetimeformat" type="abstract operation" oldids="sec-initializedatetimeformat,sec-todatetimeoptions">
@@ -1728,27 +1725,24 @@ <h1>ToLocalTime Records</h1>
17281725
</emu-table>
17291726
</emu-clause>
17301727

1731-
<emu-normative-optional>
1732-
1733-
<emu-clause id="sec-unwrapdatetimeformat" type="abstract operation">
1734-
<h1>
1735-
UnwrapDateTimeFormat (
1736-
_dtf_: an ECMAScript language value,
1737-
): either a normal completion containing an ECMAScript language value or a throw completion
1738-
</h1>
1739-
<dl class="header">
1740-
<dt>description</dt>
1741-
<dd>
1742-
It returns the DateTimeFormat instance of its input object, which is either the value itself or a value associated with it by %Intl.DateTimeFormat% according to the normative optional constructor mode of <emu-xref href="#legacy-constructor"></emu-xref>.
1743-
</dd>
1744-
</dl>
1745-
<emu-alg>
1746-
1. If _dtf_ is not an Object, throw a *TypeError* exception.
1747-
1. If _dtf_ does not have an [[InitializedDateTimeFormat]] internal slot and ? OrdinaryHasInstance(%Intl.DateTimeFormat%, _dtf_) is *true*, then
1748-
1. Return ? Get(_dtf_, %Intl%.[[FallbackSymbol]]).
1749-
1. Return _dtf_.
1750-
</emu-alg>
1751-
</emu-clause>
1752-
</emu-normative-optional>
1728+
<emu-clause id="sec-unwrapdatetimeformat" type="abstract operation" normative-optional>
1729+
<h1>
1730+
UnwrapDateTimeFormat (
1731+
_dtf_: an ECMAScript language value,
1732+
): either a normal completion containing an ECMAScript language value or a throw completion
1733+
</h1>
1734+
<dl class="header">
1735+
<dt>description</dt>
1736+
<dd>
1737+
It returns the DateTimeFormat instance of its input object, which is either the value itself or a value associated with it by %Intl.DateTimeFormat% according to the normative optional constructor mode of <emu-xref href="#legacy-constructor"></emu-xref>.
1738+
</dd>
1739+
</dl>
1740+
<emu-alg>
1741+
1. If _dtf_ is not an Object, throw a *TypeError* exception.
1742+
1. If _dtf_ does not have an [[InitializedDateTimeFormat]] internal slot and ? OrdinaryHasInstance(%Intl.DateTimeFormat%, _dtf_) is *true*, then
1743+
1. Return ? Get(_dtf_, %Intl%.[[FallbackSymbol]]).
1744+
1. Return _dtf_.
1745+
</emu-alg>
1746+
</emu-clause>
17531747
</emu-clause>
17541748
</emu-clause>

spec/index.html

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@
99
}
1010
</script>
1111
<style>
12-
emu-normative-optional {
13-
border-left: 5px solid #ff6600;
14-
padding: .5em;
15-
display: block;
16-
background: #ffeedd;
17-
}
18-
emu-normative-optional:before {
19-
display: block;
20-
color: #884400;
21-
content: "NORMATIVE OPTIONAL";
22-
}
2312
#metadata-block {
2413
margin: 4em 0;
2514
padding: 10px;

spec/numberformat.html

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,23 @@ <h1>Intl.NumberFormat ( [ _locales_ [ , _options_ ] ] )</h1>
5454
1. Return _numberFormat_.
5555
</emu-alg>
5656

57-
<emu-normative-optional>
58-
59-
<emu-clause id="sec-chainnumberformat" type="abstract operation">
60-
<h1>
61-
ChainNumberFormat (
62-
_numberFormat_: an Intl.NumberFormat,
63-
_newTarget_: an ECMAScript language value,
64-
_this_: an ECMAScript language value,
65-
): either a normal completion containing an Object or a throw completion
66-
</h1>
67-
<dl class="header">
68-
</dl>
69-
<emu-alg>
70-
1. If _newTarget_ is *undefined* and ? OrdinaryHasInstance(%Intl.NumberFormat%, _this_) is *true*, then
71-
1. Perform ? DefinePropertyOrThrow(_this_, %Intl%.[[FallbackSymbol]], PropertyDescriptor{ [[Value]]: _numberFormat_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }).
72-
1. Return _this_.
73-
1. Return _numberFormat_.
74-
</emu-alg>
75-
</emu-clause>
76-
</emu-normative-optional>
57+
<emu-clause id="sec-chainnumberformat" type="abstract operation" normative-optional>
58+
<h1>
59+
ChainNumberFormat (
60+
_numberFormat_: an Intl.NumberFormat,
61+
_newTarget_: an ECMAScript language value,
62+
_this_: an ECMAScript language value,
63+
): either a normal completion containing an Object or a throw completion
64+
</h1>
65+
<dl class="header">
66+
</dl>
67+
<emu-alg>
68+
1. If _newTarget_ is *undefined* and ? OrdinaryHasInstance(%Intl.NumberFormat%, _this_) is *true*, then
69+
1. Perform ? DefinePropertyOrThrow(_this_, %Intl%.[[FallbackSymbol]], PropertyDescriptor{ [[Value]]: _numberFormat_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }).
70+
1. Return _this_.
71+
1. Return _numberFormat_.
72+
</emu-alg>
73+
</emu-clause>
7774
</emu-clause>
7875

7976
<emu-clause id="sec-setnumberformatdigitoptions" oldids="sec-setnfdigitoptions" type="abstract operation">
@@ -1364,28 +1361,25 @@ <h1>
13641361
</emu-alg>
13651362
</emu-clause>
13661363

1367-
<emu-normative-optional>
1368-
1369-
<emu-clause id="sec-unwrapnumberformat" type="abstract operation">
1370-
<h1>
1371-
UnwrapNumberFormat (
1372-
_nf_: an ECMAScript language value,
1373-
): either a normal completion containing an ECMAScript language value or a throw completion
1374-
</h1>
1375-
<dl class="header">
1376-
<dt>description</dt>
1377-
<dd>
1378-
It returns the NumberFormat instance of its input object, which is either the value itself or a value associated with it by %Intl.NumberFormat% according to the normative optional constructor mode of <emu-xref href="#legacy-constructor"></emu-xref>.
1379-
</dd>
1380-
</dl>
1381-
<emu-alg>
1382-
1. If _nf_ is not an Object, throw a *TypeError* exception.
1383-
1. If _nf_ does not have an [[InitializedNumberFormat]] internal slot and ? OrdinaryHasInstance(%Intl.NumberFormat%, _nf_) is *true*, then
1384-
1. Return ? Get(_nf_, %Intl%.[[FallbackSymbol]]).
1385-
1. Return _nf_.
1386-
</emu-alg>
1387-
</emu-clause>
1388-
</emu-normative-optional>
1364+
<emu-clause id="sec-unwrapnumberformat" type="abstract operation" normative-optional>
1365+
<h1>
1366+
UnwrapNumberFormat (
1367+
_nf_: an ECMAScript language value,
1368+
): either a normal completion containing an ECMAScript language value or a throw completion
1369+
</h1>
1370+
<dl class="header">
1371+
<dt>description</dt>
1372+
<dd>
1373+
It returns the NumberFormat instance of its input object, which is either the value itself or a value associated with it by %Intl.NumberFormat% according to the normative optional constructor mode of <emu-xref href="#legacy-constructor"></emu-xref>.
1374+
</dd>
1375+
</dl>
1376+
<emu-alg>
1377+
1. If _nf_ is not an Object, throw a *TypeError* exception.
1378+
1. If _nf_ does not have an [[InitializedNumberFormat]] internal slot and ? OrdinaryHasInstance(%Intl.NumberFormat%, _nf_) is *true*, then
1379+
1. Return ? Get(_nf_, %Intl%.[[FallbackSymbol]]).
1380+
1. Return _nf_.
1381+
</emu-alg>
1382+
</emu-clause>
13891383

13901384
<emu-clause id="sec-getnumberformatpattern" type="abstract operation">
13911385
<h1>

0 commit comments

Comments
 (0)