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
Stringusing interpolation of runtime expressions. - vec 🔒
- Creates a
Veccontaining 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§
- Atomic
U64 🔒 - An integer type which can be safely shared between threads.