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§

build_nf_options 🔒
new Intl.NumberFormat(locales, options) と Number.prototype.toLocaleString(locales, options) の設定の解決。
canonicalize_locale_list 🔒
create_intl_constructor 🔒
create_intl_object 🔒
Intl グローバルオブジェクトを作成して返す。
ctor_locale 🔒
get_options_object 🔒
GetOptionsObject(strict)/ CoerceOptionsToObject。null は TypeError、strict では原始値も TypeError。
intl_collator_compare 🔒
intl_collator_ctor 🔒
intl_collator_resolved_options 🔒
intl_collator_supported_locales_of 🔒
intl_ctor_common 🔒
Intl.* コンストラクタの共通の前処理(new の確認・ロケール・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 🔒
intl_supported_locales_of 🔒
intl_supported_values_of 🔒
nf_from_obj 🔒
nf_locale 🔒
ロケールの引数(文字列・配列風オブジェクト・Locale・未指定)から先頭のタグを取る(正規化済み)。
nf_of 🔒
nf_to_obj 🔒
nf_value 🔒
値を数にする(BigInt・文字列も。Intl.NumberFormat.prototype.format(x) の ToNumeric)。
opt_bool 🔒
opt_num 🔒
整数のオプション(min..=max)。範囲外は RangeError。
opt_obj_get 🔒
opt_str 🔒
文字列のオプション。許された値以外は RangeError。
proto_chain_includes 🔒
newを介さない裸呼び出し(Intl.NumberFormat()。Intl系コンストラクタは 仕様上どちらの呼び出し形式でも動作可能でなければならない)を正しく扱う。 メンバ呼出(Intl.NumberFormat(...))のthisは「メンバ式のレシーバ」 (interp/calls.rsのeval_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 発見・実装。
require_brand 🔒
内部スロット _intl_type による型の確認(ブランドチェック)。
resolve_intl_this 🔒
new / Reflect.construct / super() / 裸呼び出し(Intl.NumberFormat())を統一的に扱う。
resolve_numbering 🔒
数字の体系(numberingSystem オプションとタグの -u-nu-)を解決して (ロケール, 体系) を返す。
set_slot 🔒
slot 🔒
strip_extensions 🔒
拡張(-u-・-x- など)を除いたタグ。
sv 🔒
u_ext_nu 🔒
タグの Unicode 拡張(-u-)にある nu キーの値。