Skip to main contentModule extra_static
Source - apply_define_property 🔒
- array_of 🔒
- data_descriptor 🔒
- データ記述子
{value, writable, enumerable, configurable}。 - define_allowed 🔒
- ValidateAndApplyPropertyDescriptor の拒否条件(§10.1.6.3)。
Some(true) で定義してよい。
現在の記述子は make_property_descriptor から読む。 - define_own_property_checked 🔒
- DefinePropertyOrThrow: 拒否条件に当たれば TypeError、そうでなければ
apply_define_property。 - define_properties_from 🔒
- ObjectDefineProperties (§20.1.2.3.1):
props を ToObject し、自前の列挙可能キーごとに [[Get]] して
ToPropertyDescriptor を全部済ませてから(途中で失敗したら何も定義しない)、順に DefinePropertyOrThrow する。 - define_property_desc 🔒
- 完成した記述子
desc(to_property_descriptor の結果)を通常のオブジェクトへ定義する。拒否は TypeError。 - desc_has_property 🔒
- [[HasProperty]]。
has_property_chain は関数の暗黙の Function.prototype を辿らないため、
明示的な原型が無ければ implicit_proto で補いながら自分で連鎖を歩く(Proxy は trap に任せる)。 - effective_proto 🔒
- オブジェクトのプロトタイプ(
Object.getPrototypeOf の結果)。 - from_entries_add 🔒
Object.fromEntries の 1 エントリ(オブジェクト必須、"0"/"1" を [[Get]]、キーは ToPropertyKey)。- global_ctor_proto 🔒
- グローバルのコンストラクタ
name の prototype。 - global_proto_obj 🔒
- グローバルのスコープ
global にあるコンストラクタ name の prototype(Interp を作る前に使う)。 - has_own_or_virtual 🔒
- 自前のプロパティ(データ・accessor・配列の要素・関数の仮想
name/length)を持つか。 - implicit_proto 🔒
o のプロトタイプ(明示的な proto、無ければ種類に応じた組込みの prototype、
その先は Object.prototype。Object.prototype 自身と null_proto は None)。
Object.getPrototypeOf と instanceof が共有する。【2026-10-17】instanceof は
配列・素のオブジェクト以外の組込み(Promise・Map 等)を辿れず、p instanceof Promise
が偽になっていた(YouTube の遅延コンポーネントが Promise を要素名として描こうとした)。- make_property_descriptor 🔒
- math_acos 🔒
- math_acosh 🔒
- math_asin 🔒
- math_asinh 🔒
- math_atan 🔒
- math_atan2 🔒
- math_atanh 🔒
- math_cbrt 🔒
- math_clamp 🔒
Math.clamp(x, min, max)(ECMAScript Proposal Stage 3/4)。
数値 x を [min, max] の範囲内に制限する。- math_clz32 🔒
Math.clz32(x)(ES2015)が丸ごと未対応だった。x を仕様どおり ToUint32
(下位32bitへ切り詰め)してから先頭の連続 0 ビット数を返す(x=0 は 32)。- math_cosh 🔒
- math_expm1 🔒
- math_f16round 🔒
Math.f16round(x)(ES2025)。半精度 16bit 浮動小数点数(IEEE 754 half-precision float)
として表現可能な最も近い値へ丸める(Float16Array と同等の丸め)。- math_fround 🔒
Math.fround(x)(ES2015)が丸ごと未対応だった。32bit 単精度浮動小数点として
表現可能な最も近い値へ丸める(WebGL/Canvas 等で GPU 側の float32 精度に
合わせる定番イディオム)。f64 -> f32 -> f64 の往復キャストで単精度の
丸め誤差を再現する。- math_hypot 🔒
- math_imul 🔒
Math.imul(a, b)(ES2015)が丸ごと未対応だった。両引数を ToInt32 してから
32bit 整数の乗算をラップアラウンド(オーバーフロー時は下位32bitのみ保持)で
行う。通常の浮動小数点乗算は 2^53 を超えると精度落ちするため、64bit整数の
大きな値を正確に掛け合わせたい場面で使われる。- math_log2 🔒
- math_log1p 🔒
- math_log10 🔒
- math_sinh 🔒
- math_sum_precise 🔒
Math.sumPrecise(iterable)(ES2025 Standard)。
反復可能オブジェクト(Array, Set, Map Iterator 等)内のすべての数値を正確に合計する。
特殊値 (NaN, +Inf/-Inf の混在) や IEEE 754 の丸め誤差を Kahan-Babuška-Neumaier 補正加算で精密に処理。- math_tan 🔒
- math_tanh 🔒
- number_is_finite_static 🔒
- number_is_integer 🔒
- number_is_nan_static 🔒
- number_is_safe_integer 🔒
- object_create 🔒
- object_define_properties 🔒
- object_define_property 🔒
- object_freeze 🔒
Object.freeze(obj)。以前は「凍結は no-op(同一オブジェクトを返すだけ)」という
明示的な簡略化だったが、set_property()/delete 側に frozen フラグの実チェックを
追加したことで、実際にプロパティの追加・変更・削除を黙殺するようになった。- object_from_entries 🔒
- object_get_own_property_descriptor 🔒
- object_get_own_property_descriptors 🔒
- object_get_prototype_of 🔒
Object.getPrototypeOf(obj)(ES5)。Reflect.getPrototypeOf と同じロジックだが、
こちらは instanceof/クラス継承の確認によく使われる、はるかに一般的な API。- object_is 🔒
Object.is(a, b)(ES2015、SameValue)。===/SameValueZero と違い、NaN 同士は
等しいと判定し、かつ +0/-0 は区別して等しくないと判定する(両方の性質を持つのは
SameValue だけ。SameValueZero は +0/-0 を区別しない)。- object_is_extensible 🔒
- object_is_frozen 🔒
Object.isFrozen(obj)。プリミティブは仕様どおり常に true(凍結済み扱い)。- object_is_sealed 🔒
- object_prevent_extensions 🔒
Object.preventExtensions(obj)(seal よりさらに弱い: 新規プロパティの追加のみ禁止)。- object_seal 🔒
Object.seal(obj)(freeze より弱い: 新規プロパティの追加・既存プロパティの削除のみ
禁止し、既存値の変更は許可する)。freeze と同様、以前は丸ごと欠落していた。- object_set_prototype_of 🔒
Object.setPrototypeOf(obj, proto)(ES6)。proto が null ならプロトタイプ連鎖を切る。- ordinary_or_proxy_set_prototype_of 🔒
- [[SetPrototypeOf]](Proxy なら trap、通常オブジェクトなら OrdinarySetPrototypeOf)。成否を返す。
- ordinary_set_prototype_of 🔒
- proxy_define_property_trap 🔒
- same_value_pd 🔒
- string_from_char_code 🔒
- string_from_code_point 🔒
- string_raw 🔒
- to_property_descriptor 🔒
- ToPropertyDescriptor (§6.2.6.5): 記述子オブジェクトを検査し、存在するフィールドだけを持つ素のオブジェクトにする。
継承したフィールドと getter も [[HasProperty]]/[[Get]] で読む。get/set が呼べない・data と accessor の混在は TypeError。
- validate_array_length 🔒
- 配列の
length 記述子値を ECMA-262 ArraySetLength (§10.4.2.4) に従って検証・変換する。 - virtual_fn_prop_value 🔒
- 関数の仮想自前プロパティ
name / length の値を求める(未削除かつ props/accessors に未登録のときのみ Some)。