Changeset 278697 in webkit


Ignore:
Timestamp:
Jun 10, 2021 1:06:59 AM (14 months ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Ignore Intl.NumberFormat feature options when linked-ICU is old
https://bugs.webkit.org/show_bug.cgi?id=226861
rdar://77393100

Reviewed by Ross Kirsling.

Let's just ignore the option when Intl.NumberFormat features cannot be implemented since the linked ICU is old.
There is no way not to expose these features since Intl.NumberFormat's these changes are additional ones and Intl.NumberFormat existed before.

  • runtime/IntlNumberFormat.cpp:

(JSC::IntlNumberFormat::initializeNumberFormat):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r278696 r278697  
     12021-06-10  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Ignore Intl.NumberFormat feature options when linked-ICU is old
     4        https://bugs.webkit.org/show_bug.cgi?id=226861
     5        rdar://77393100
     6
     7        Reviewed by Ross Kirsling.
     8
     9        Let's just ignore the option when Intl.NumberFormat features cannot be implemented since the linked ICU is old.
     10        There is no way not to expose these features since Intl.NumberFormat's these changes are additional ones and Intl.NumberFormat existed before.
     11
     12        * runtime/IntlNumberFormat.cpp:
     13        (JSC::IntlNumberFormat::initializeNumberFormat):
     14
    1152021-06-09  Ross Kirsling  <ross.kirsling@sony.com>
    216
  • trunk/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp

    r278253 r278697  
    546546            break;
    547547        case CurrencyDisplay::NarrowSymbol:
    548             throwTypeError(globalObject, scope, "Failed to initialize NumberFormat since used feature is not supported in the linked ICU version"_s);
    549             return;
     548            style = UNUM_CURRENCY; // Use the same option to "symbol" since linked-ICU does not support it.
     549            break;
    550550        case CurrencyDisplay::Name:
    551551            style = UNUM_CURRENCY_PLURAL;
     
    556556            break;
    557557        case CurrencySign::Accounting:
    558             throwTypeError(globalObject, scope, "Failed to initialize NumberFormat since used feature is not supported in the linked ICU version"_s);
    559             return;
     558            // Ignore this case since linked ICU does not support it.
     559            break;
    560560        }
    561561        break;
    562562    case Style::Unit:
    563         throwTypeError(globalObject, scope, "Failed to initialize NumberFormat since used feature is not supported in the linked ICU version"_s);
    564         return;
     563        // Ignore this case since linked ICU does not support it.
     564        break;
    565565    }
    566566
     
    571571    case IntlNotation::Engineering:
    572572    case IntlNotation::Compact:
    573         throwTypeError(globalObject, scope, "Failed to initialize NumberFormat since used feature is not supported in the linked ICU version"_s);
    574         return;
     573        // Ignore this case since linked ICU does not support it.
     574        break;
    575575    }
    576576
     
    581581    case SignDisplay::Always:
    582582    case SignDisplay::ExceptZero:
    583         throwTypeError(globalObject, scope, "Failed to initialize NumberFormat since used feature is not supported in the linked ICU version"_s);
    584         return;
     583        // Ignore this case since linked ICU does not support it.
     584        break;
    585585    }
    586586
     
    612612        break;
    613613    case IntlRoundingType::CompactRounding:
    614         throwTypeError(globalObject, scope, "Failed to initialize NumberFormat since used feature is not supported in the linked ICU version"_s);
    615         return;
     614        // Ignore this case since linked ICU does not support it.
     615        break;
    616616    }
    617617    unum_setAttribute(m_numberFormat.get(), UNUM_GROUPING_USED, m_useGrouping);
Note: See TracChangeset for help on using the changeset viewer.