Skip to main content

Module builtins

Module builtins 

Source
Expand description

ECMAScript 標準ライブラリ(純粋な言語組み込みオブジェクト群)。

DOM / Fetch / Storage / Performance 等のブラウザ Web API は crate::os_lib::web_apis::builtins が担当する。 ここでは純粋な ECMAScript 組み込みとグローバルオブジェクト globalThis を登録する。

Modules§

atomics 🔒
ECMAScript Atomics オブジェクト(ES2017〜ES2025)。
collections 🔒
console_math_json 🔒
date 🔒
disposable 🔒
ECMAScript Explicit Resource Management: DisposableStack と AsyncDisposableStack。
encoding 🔒
errors_misc 🔒
extra_methods 🔒
extra_static 🔒
intl 🔒
Intl (ECMAScript Internationalization API Specification) 実装。
intl_locale 🔒
Intl.Locale (ECMA-402 §14) の実装。
iter_helpers 🔒
object_array 🔒
promise 🔒
props_methods 🔒
regexp 🔒
regexp_proto 🔒
timers_gen 🔒
typed_array 🔒
vec 🔒
A contiguous growable array type with heap-allocated contents, written Vec<T>.
weak_symbol 🔒

Macros§

format 🔒
Creates a String using interpolation of runtime expressions.
vec 🔒
Creates a Vec containing the arguments.

Structs§

Rc 🔒
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
RefCell 🔒
A mutable memory location with dynamically checked borrow rules
String 🔒
A UTF-8–encoded, growable string.
Vec 🔒
A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Enums§

Ordering 🔒
Atomic memory orderings

Constants§

ARRAY_PROTO_METHODS 🔒
Array.prototype に並べるメソッド名。
ES_BUILTIN_GLOBALS 🔒
ECMAScript の組み込みのコンストラクタ・名前空間(mark_builtin_props が属性を付ける)。 DOM(WebIDL)のインタフェースは属性・操作が列挙できるのが仕様なので入れない。
STRING_PROTO_METHODS 🔒
String.prototype に並べるメソッド名。

Traits§

ToString 🔒
A trait for converting a value to a String.

Functions§

arg 🔒
引数配列から i 番目を取得(無ければ Undefined)。
ecma_noop 🔒
何もしないネイティブ関数(ECMAScript 側での空スタブ用)。
ensure_ctor_prototypes
大文字で始まる呼び出し可能なグローバルに prototype が無ければ空の prototype(constructor 付き)を補う。
install
グローバルスコープへ純粋 ECMAScript 組込みを登録する。
mark_builtin_props
組み込みのプロパティの属性(2026-11-16)。仕様では組み込みのメソッドは列挙しない (Object.keys(Math) は空・for (k in Object.prototype) は何も出さない)。数値の定数 (Math.PI・Number.MAX_SAFE_INTEGER)と既知のシンボル(Symbol.iterator)は書き換えもできない。 以前は属性が無く、すべて列挙・書き換えできた。install の後で一度だけ呼ぶ(後から足した物は対象外)。
nv 🔒
ネイティブ関数値を作るショートカット。
obj_prop 🔒
Value::Object のプロパティを取得(非オブジェクトは None)。
populate_builtin_protos
実体の種類から動的に引いている組み込みのメソッドを、X.prototype にも並べる(2026-11-16)。 以前は Number.prototype.toFixed・Promise.prototype.then・Map.prototype.set・Date.prototype.getTime が undefined だった(実体の (1).toFixed・p.then などは動いていた)。同じ関数を指すので二重実装にならない。 JsRuntime::new_ecma / JsRuntime::new_with_host が install の直後に一度だけ呼ぶ。
prim_num_args 🔒
数値を取る組込み(Math.*・String.fromCharCode)の引数を、仕様の ToNumber の前段(ToPrimitive、 hint “number”)にかける。オブジェクトが無ければ借りたまま返す(確保しない)。

Type Aliases§

AtomicU64 🔒
An integer type which can be safely shared between threads.