Skip to main content

Module intl

Module intl 

Source
Expand description

Intl (ECMAScript Internationalization API Specification) 実装。

Intl.NumberFormat, Intl.DateTimeFormat, Intl.Collator, Intl.PluralRules, Intl.RelativeTimeFormat, Intl.Segmenter, Intl.ListFormat, Intl.DisplayNames, および Intl.getCanonicalLocales を提供する。

Functions§

create_intl_constructor 🔒
create_intl_object 🔒
Intl グローバルオブジェクトを作成して返す。
group_thousands 🔒
千の位区切り(,)を挿入する。この処理系には本格的なCLDR数値書式 データベースが無いため、en-USをはじめとする「3桁ごとにカンマ区切り、 小数点は.」というASCII圏で最も一般的な書式のみを既定で適用する簡略 実装(de-DEのようなカンマ/ピリオドが逆の書式や桁区切り位置が異なる ロケール、useGrouping:false等のオプションは非対応。既存の oklch()/Float16Array等の「1ビットの誤りが静かに間違った数値を 生み続けるリスク」とは異なり、整数の3桁区切りは目視でも容易に検証 でき、かつ最もよく使われる書式のため実装した)。
intl_collator_compare 🔒
intl_collator_ctor 🔒
intl_collator_resolved_options 🔒
intl_datetime_format_ctor 🔒
intl_datetime_format_format 🔒
intl_datetime_format_format_to_parts 🔒
intl_datetime_format_resolved_options 🔒
intl_display_names_ctor 🔒
intl_display_names_of 🔒
intl_display_names_resolved_options 🔒
intl_duration_format_ctor 🔒
intl_duration_format_format 🔒
intl_duration_format_format_to_parts 🔒
intl_duration_format_resolved_options 🔒
intl_get_canonical_locales 🔒
intl_list_format_ctor 🔒
intl_list_format_format 🔒
intl_list_format_format_to_parts 🔒
intl_list_format_resolved_options 🔒
intl_number_format_ctor 🔒
intl_number_format_format 🔒
intl_number_format_format_to_parts 🔒
intl_number_format_resolved_options 🔒
intl_plural_rules_ctor 🔒
intl_plural_rules_resolved_options 🔒
intl_plural_rules_select 🔒
intl_relative_time_format_ctor 🔒
intl_relative_time_format_format 🔒
intl_relative_time_format_format_to_parts 🔒
intl_relative_time_format_resolved_options 🔒
intl_segmenter_ctor 🔒
intl_segmenter_resolved_options 🔒
intl_segmenter_segment 🔒
parse_locale 🔒
resolve_intl_this 🔒
newを介さない裸呼び出し(Intl.NumberFormat()Intl系コンストラクタは 仕様上どちらの呼び出し形式でも動作可能でなければならない)を正しく扱う。 メンバ呼出(Intl.NumberFormat(...))のthisは「メンバ式のレシーバ」 (interp/calls.rseval_callのコメントどおり)、つまりIntl 名前空間オブジェクト自身になる。以前は「thisがオブジェクトなら そのまま使う」という判定だったため、newを省略するとIntlオブジェクト 自身に_intl_type/_localeを書き込んでしまい(Intl名前空間の汚染)、 かつIntlのproto連鎖には.format等が無いため常にundefinedになる バグだった。正しくはthisのprotoが既に対象コンストラクタの prototypeと一致する場合(new経由。construct_objectが設定済み) のみそのオブジェクトを再利用し、それ以外(裸呼び出し)はIntl.<name>. prototypeへ明示的に繋いだ新規オブジェクトを都度生成する。 2026-07-18 発見・実装。