diff --git a/spec/conventions.html b/spec/conventions.html index 787dd319..6420561b 100644 --- a/spec/conventions.html +++ b/spec/conventions.html @@ -24,6 +24,10 @@

Notational Conventions

For ECMAScript objects, this standard may use variable-named internal slots: The notation "[[<_name_>]]" denotes an internal slot whose name is given by the variable name, which must have a String value. For example, if a variable _s_ has the value *"a"*, then [[<_s_>]] denotes the [[<_a_>]] internal slot.

+

+ This specification uses blocks demarcated as Normative Optional to denote the sense of Annex B in ECMA 262. That is, normative optional sections are required when the ECMAScript host is a web browser. The content of the section is normative but optional if the ECMAScript host is not a web browser. +

+

Well-Known Intrinsic Objects

diff --git a/spec/datetimeformat.html b/spec/datetimeformat.html index fe6c5955..1fa47161 100644 --- a/spec/datetimeformat.html +++ b/spec/datetimeformat.html @@ -370,6 +370,28 @@

ToLocalTime ( _date_, _calendar_, _timeZone_ )

It is recommended that implementations use the time zone information of the IANA Time Zone Database.
+ + +

UnwrapDateTimeFormat( _dtf_ )

+

+ The UnwrapDateTimeFormat abstract operation gets the underlying DateTimeFormat operation + for various methods which implement ECMA-402 v1 semantics for supporting initializing + existing Intl objects. +

+ Normative Optional
+ + 1. If _dtf_ does not have an [[InitializedDateTimeFormat]] internal slot and ? InstanceofOperator(_dtf_, %DateTimeFormat%) is equal *true*, then + 1. Let _obj_ be Get(_dtf_, Intl.[[FallbackSymbol]]). + 1. Let _dtf_ be ? RequireObjectCoercible(_obj_). + +
+ + 2. If _dtf_ does not have an [[InitializedDateTimeFormat]] internal slot, + 1. Throw a *TypeError* exception. + 1. Return _dtf_. + +
+ @@ -389,7 +411,18 @@

Intl.DateTimeFormat ( [ _locales_ [ , _options_ ] ] )

1. If NewTarget is *undefined*, let _newTarget_ be the active function object, else let _newTarget_ be NewTarget. 1. Let _dateTimeFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, `"%DateTimeFormatPrototype%"`, « [[InitializedIntlObject]], [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[Hour]], [[Minute]], [[Second]], [[TimeZoneName]], [[Hour12]], [[HourNo0]], [[Pattern]], [[BoundFormat]] »). - 1. Return ? InitializeDateTimeFormat(_dateTimeFormat_, _locales_, _options_). + 1. Perform ? InitializeDateTimeFormat(_dateTimeFormat_, _locales_, _options_). + + Normative Optional
+ + 4. Let _this_ be the *this* value. + 1. If NewTarget is *undefined* and ? InstanceofOperator(_this_, %NumberFormat%), + 1. Perform ? DefineOwnPropertyOrThrow(_this_, Intl.[[FallbackSymbol]], { [[Value]]: _dateTimeFormat_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return _this_. + +
+ + 6. Return _dateTimeFormat_.
@@ -522,7 +555,7 @@

get Intl.DateTimeFormat.prototype.format

1. Let _dtf_ be *this* value. 1. If Type(_dtf_) is not Object, throw a *TypeError* exception. - 1. If _dtf_ does not have an [[InitializedDateTimeFormat]] internal slot, throw a *TypeError* exception. + 1. Let _dtf_ be ? UnwrapDateTimeFormat(_dtf_). 1. If _dtf_.[[BoundFormat]] is *undefined*, then 1. Let _F_ be a new built-in function object as defined in DateTime Format Functions (). 1. Let _bf_ be BoundFunctionCreate(_F_, _dft_, « »). @@ -555,7 +588,7 @@

Intl.DateTimeFormat.prototype.formatToParts ( [ _date_ ] )

Intl.DateTimeFormat.prototype.resolvedOptions ()

- This function provides access to the locale and formatting options computed during initialization of the object. + This function provides access to the locale and formatting options computed during initialization of the object. This function initially invokes the internal algorithm UnwrapDateTimeFormat to get the %DateTimeFormat% object on which to operate.

diff --git a/spec/index.html b/spec/index.html index 9dd67989..09219f00 100644 --- a/spec/index.html +++ b/spec/index.html @@ -25,6 +25,20 @@ margin-bottom: 10px; padding-left: 10px; } + +emu-normative-optional { + margin: 1em 0; + border-left: 5px solid #ff6600; + display: block; + background: #ffeedd; +} + +span.normative-optional { + padding-left: 5px; + text-transform: uppercase; + color: #884400; +} +

diff --git a/spec/intl.html b/spec/intl.html
index 82648599..6ddcf0f9 100644
--- a/spec/intl.html
+++ b/spec/intl.html
@@ -12,6 +12,10 @@ 

The Intl Object

The Intl object is not a function object. It does not have a [[Construct]] internal method; it is not possible to use the Intl object as a constructor with the *new* operator. The Intl object does not have a [[Call]] internal method; it is not possible to invoke the Intl object as a function.

+

+ The Intl object has an internal slot, [[FallbackSymbol]], which is a new %Symbol% in the current realm. +

+

Constructor Properties of the Intl Object

diff --git a/spec/numberformat.html b/spec/numberformat.html index 9b397789..13a6ed1d 100644 --- a/spec/numberformat.html +++ b/spec/numberformat.html @@ -448,6 +448,27 @@

ToRawFixed( _x_, _minInteger_, _minFraction_, _maxFraction_ )

1. Return _m_.
+ + +

UnwrapNumberFormat( _nf_ )

+

+ The UnwrapNumberFormat abstract operation gets the underlying NumberFormat operation + for various methods which implement ECMA-402 v1 semantics for supporting initializing + existing Intl objects. +

+ Normative Optional
+ + 1. If _nf_ does not have an [[InitializedNumberFormat]] internal slot and ? InstanceofOperator(_nf_, %NumberFormat%)is equal *true*, then + 1. Let _obj_ be Get(_nf_, Intl.[[FallbackSymbol]]). + 1. Let _nf_ be ? RequireObjectCoercible(_obj_). + +
+ + 2. If _nf_ does not have an [[InitializedNumberFormat]] internal slot, then + 1. Throw a *TypeError* exception. + 1. Return _nf_. + +
@@ -467,7 +488,18 @@

Intl.NumberFormat ( [ _locales_ [ , _options_ ] ] )

1. If NewTarget is *undefined*, let _newTarget_ be the active function object, else let _newTarget_ be NewTarget. 1. Let _numberFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, `"%NumberFormatPrototype%"`, « [[InitializedIntlObject]], [[InitializedNumberFormat]], [[Locale]], [[NumberingSystem]], [[Style]], [[Currency]], [[CurrencyDisplay]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[UseGrouping]], [[PositivePattern]], [[NegativePattern]], [[BoundFormat]] »). - 1. Return ? InitializeNumberFormat(_numberFormat_, _locales_, _options_). + 1. Perform ? InitializeNumberFormat(_numberFormat_, _locales_, _options_). + + Normative Optional
+ + 4. Let _this_ be the *this* value. + 1. If NewTarget is *undefined* and ? InstanceofOperator(_this_, %NumberFormat%), + 1. Perform ? DefineOwnPropertyOrThrow(_this_, Intl.[[FallbackSymbol]], { [[Value]]: _numberFormat_, [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return _this_. + +
+ + 6. Return _numberFormat_.
@@ -577,7 +609,7 @@

get Intl.NumberFormat.prototype.format

1. Let _nf_ be *this* value. 1. If Type(_nf_) is not Object, throw a *TypeError* exception. - 1. If _nf_.[[InitializedNumberFormat]] is *true*, throw a *TypeError* exception. + 1. Let _nf_ be ? UnwrapNumberFormat(_nf_); 1. If _nf_.[[BoundFormat]] is *undefined*, then 1. Let _F_ be a new built-in function object as defined in Number Format Functions (). 1. Let _bf_ be BoundFunctionCreate(_F_, _nf_, « »). @@ -591,7 +623,7 @@

get Intl.NumberFormat.prototype.format

Intl.NumberFormat.prototype.resolvedOptions ()

- This function provides access to the locale and formatting options computed during initialization of the object. + This function provides access to the locale and formatting options computed during initialization of the object. This function initially invokes the internal algorithm UnwrapNumberFormat to get the %NumberFormat% object on which to operate.

The function returns a new object whose properties and attributes are set as if constructed by an object literal assigning to each of the following properties the value of the corresponding internal slot of this NumberFormat object (see ): locale, numberingSystem, style, currency, currencyDisplay, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, minimumSignificantDigits, maximumSignificantDigits, and useGrouping. Properties whose corresponding internal slots have the value *undefined* are not assigned.