src/third_party/mozjs/extract/js/src/builtin/intl/NumberFormat.js
/**
 * Compute an internal properties object from |lazyNumberFormatData|.
 */
Compute an internal properties object from |lazyNumberFormatData|.
Compute an internal properties object from |lazyNumberFormatData| .
function resolveNumberFormatInternals(lazyNumberFormatData) {
    assert(IsObject(lazyNumberFormatData), "lazy data not an object?");
    var internalProps = std_Object_create(null);
    var NumberFormat = numberFormatInternalProperties;
    var localeData = NumberFormat.localeData;
    var r = ResolveLocale("NumberFormat",
                          lazyNumberFormatData.requestedLocales,
                          lazyNumberFormatData.opt,
                          NumberFormat.relevantExtensionKeys,
                          localeData);
    internalProps.locale = r.locale;
    internalProps.numberingSystem = r.nu;
    var style = lazyNumberFormatData.style;
    internalProps.style = style;
    if (style === "currency") {
        internalProps.currency = lazyNumberFormatData.currency;
        internalProps.currencyDisplay = lazyNumberFormatData.currencyDisplay;
        internalProps.currencySign = lazyNumberFormatData.currencySign;
    }
    if (style === "unit") {
        internalProps.unit = lazyNumberFormatData.unit;
        internalProps.unitDisplay = lazyNumberFormatData.unitDisplay;
    }
    var notation = lazyNumberFormatData.notation;
    internalProps.notation = notation;
    internalProps.minimumIntegerDigits = lazyNumberFormatData.minimumIntegerDigits;
    if ("minimumFractionDigits" in lazyNumberFormatData) {
        assert("maximumFractionDigits" in lazyNumberFormatData, "min/max frac digits mismatch");
        internalProps.minimumFractionDigits = lazyNumberFormatData.minimumFractionDigits;
        internalProps.maximumFractionDigits = lazyNumberFormatData.maximumFractionDigits;
    }
    if ("minimumSignificantDigits" in lazyNumberFormatData) {
        assert("maximumSignificantDigits" in lazyNumberFormatData, "min/max sig digits mismatch");
        internalProps.minimumSignificantDigits = lazyNumberFormatData.minimumSignificantDigits;
        internalProps.maximumSignificantDigits = lazyNumberFormatData.maximumSignificantDigits;
    }
    if (notation === "compact")
        internalProps.compactDisplay = lazyNumberFormatData.compactDisplay;
    internalProps.useGrouping = lazyNumberFormatData.useGrouping;
    internalProps.signDisplay = lazyNumberFormatData.signDisplay;
    return internalProps;
}
function resolveNumberFormatInternals ( lazyNumberFormatData ) { assert ( IsObject ( lazyNumberFormatData ) , "lazy data not an object?" ) ; var internalProps = std_Object_create ( null ) ; var NumberFormat = numberFormatInternalProperties ; var localeData = NumberFormat . localeData ; var r = ResolveLocale ( "NumberFormat" , lazyNumberFormatData . requestedLocales , lazyNumberFormatData . opt , NumberFormat . relevantExtensionKeys , localeData ) ; internalProps . locale = r . locale ; internalProps . numberingSystem = r . nu ; var style = lazyNumberFormatData . style ; internalProps . style = style ; if ( style === "currency" ) { internalProps . currency = lazyNumberFormatData . currency ; internalProps . currencyDisplay = lazyNumberFormatData . currencyDisplay ; internalProps . currencySign = lazyNumberFormatData . currencySign ; } if ( style === "unit" ) { internalProps . unit = lazyNumberFormatData . unit ; internalProps . unitDisplay = lazyNumberFormatData . unitDisplay ; } var notation = lazyNumberFormatData . notation ; internalProps . notation = notation ; internalProps . minimumIntegerDigits = lazyNumberFormatData . minimumIntegerDigits ; if ( "minimumFractionDigits" in lazyNumberFormatData ) { assert ( "maximumFractionDigits" in lazyNumberFormatData , "min/max frac digits mismatch" ) ; internalProps . minimumFractionDigits = lazyNumberFormatData . minimumFractionDigits ; internalProps . maximumFractionDigits = lazyNumberFormatData . maximumFractionDigits ; } if ( "minimumSignificantDigits" in lazyNumberFormatData ) { assert ( "maximumSignificantDigits" in lazyNumberFormatData , "min/max sig digits mismatch" ) ; internalProps . minimumSignificantDigits = lazyNumberFormatData . minimumSignificantDigits ; internalProps . maximumSignificantDigits = lazyNumberFormatData . maximumSignificantDigits ; } if ( notation === "compact" ) internalProps . compactDisplay = lazyNumberFormatData . compactDisplay ; internalProps . useGrouping = lazyNumberFormatData . useGrouping ; internalProps . signDisplay = lazyNumberFormatData . signDisplay ; return internalProps ; }
Compute an internal properties object from |lazyNumberFormatData|.
Compute an internal properties object from |lazyNumberFormatData| .
// Compute effective locale. // Step 7. // Step 8. // Steps 9-10. (Step 11 is not relevant to our implementation.) // Compute formatting options. // Step 13. // Steps 17, 19. // Intl.NumberFormat Unified API Proposal // Intl.NumberFormat Unified API Proposal // Step 22. // Note: Intl.NumberFormat.prototype.resolvedOptions() exposes the // actual presence (versus undefined-ness) of these properties. // Note: Intl.NumberFormat.prototype.resolvedOptions() exposes the // actual presence (versus undefined-ness) of these properties. // Intl.NumberFormat Unified API Proposal // Step 24. // Intl.NumberFormat Unified API Proposal // The caller is responsible for associating |internalProps| with the right // object using |setInternalProperties|.