diff --git a/spec/intl.html b/spec/intl.html index a8d3c026..0c95e3d5 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 f49a4622..6d6721d1 100644 --- a/spec/numberformat.html +++ b/spec/numberformat.html @@ -328,6 +328,25 @@

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. +

+ + 1. If _nf_ does not have an [[initializedNumberFormat]] internal slot, + 1. If ? InstanceofOperator(_nf_, %NumberFormat%), + 1. Let _fallback_ be ? RequireObjectCoercible(Get(_nf_, Intl.[[FallbackSymbol]])). + 1. If _fallback_ has an [[initializedNumberFormat]] internal slot, + 1. Let _nf_ be _fallback_. + 1. Else, throw a *TypeError* exception. + 1. Else, throw a *TypeError* exception. + 1. Return _nf_. + +
@@ -346,6 +365,10 @@

Intl.NumberFormat ([ locales [ , options ]])

1. If NewTarget is *undefined*, let _newTarget_ be the active function object, else let _newTarget_ be NewTarget. + 1. Let _this_ be the receiver. + 1. If _this_ is not *undefined*, and ? InstanceofOperator(_this_, %NumberFormat%), + 1. Perform ? DefineOwnPropertyOrThrow(_this_, Intl.[[FallbackSymbol]], { [[Value]]: Construct(%NumberFormat%, _locales_, _options_), [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). + 1. Return _this_. 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_). @@ -457,7 +480,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_ does not have an [[initializedNumberFormat]] internal slot, 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_, « »). @@ -471,7 +494,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.