Skip to main content

Interp

Struct Interp 

Source
pub struct Interp {
Show 25 fields pub steps: u64, pub max_steps: u64, pub depth: u32, pub max_depth: u32, pub stack_limit: (usize, usize), pub aborted: bool, pub out: String, pub dom: Rc<RefCell<DomBridge>>, pub microtasks: Rc<RefCell<VecDeque<Job>>>, gen_replay: Option<GenReplay>, pub macrotasks: Rc<RefCell<VecDeque<TimerTask>>>, pub clock_skew: Rc<Cell<u64>>, pub base_url: String, pub global: Rc<RefCell<Scope>>, pub io_callbacks: Vec<Value>, pub modules: ModuleRegistry, pending_label: Option<String>, pending_new_target: Option<Value>, pub(crate) ce_upgrade_target: Option<usize>, pub(crate) ce_processing: bool, pub(crate) ce_stack: Vec<(usize, Value)>, pub(crate) dom_builtin_lookup: bool, new_target_stack: Vec<Value>, pub call_names: Vec<String>, pub tmp_bodies: Vec<Option<Rc<FnBody>>>,
}
Expand description

1 回の評価セッションの実行器(ステップ予算等を保持)。

Fields§

§steps: u64§max_steps: u64§depth: u32§max_depth: u32§stack_limit: (usize, usize)

JS 呼び出しを打ち切る SP の下限と、そのスタックの上端(js_stack_window)。 別スレッドから使われて SP が範囲外になったら求め直す。

§aborted: bool§out: String§dom: Rc<RefCell<DomBridge>>

DOM ブリッジ(ネイティブ DOM メソッドが借用して読み書きする)。

§microtasks: Rc<RefCell<VecDeque<Job>>>

Promise マイクロタスクキュー(ランタイムと共有)。

§gen_replay: Option<GenReplay>

generator 本体を replay 実行中の一時状態(None なら通常実行)。

§macrotasks: Rc<RefCell<VecDeque<TimerTask>>>

タイマーのキュー(ランタイムと共有)。

§clock_skew: Rc<Cell<u64>>

タイマー用の仮想時刻のずれ(ランタイムと共有)。

§base_url: String

現在ページの絶対URL(fetch/XHR の相対URL解決の基準。未設定なら空)。

§global: Rc<RefCell<Scope>>

グローバルスコープ(location/history などネイティブ側からの参照用)。

§io_callbacks: Vec<Value>

IntersectionObserver コールバックキュー(ページ実行後に fire_intersection_observers で発火)。

§modules: ModuleRegistry

登録済み ES モジュール(ランタイムと共有)。

§pending_label: Option<String>

Statement::Labeled がループ文を実行する直前にセットする、そのループ自身の ラベル名(break label/continue label が「自分宛て」かどうかの判定に使う)。 ループの実行開始直後に take() で消費するため、ネストしたループ/ラベルには 影響しない(exec_stmt のシグネチャにラベル引数を追加する代わりの軽量な方式)。

§pending_new_target: Option<Value>

construct_object() が new 経由の呼び出し直前にセットする、その呼び出し先 コンストラクタ自身の値。call_value_inner の CallKind::User 実行開始時に take() して new_target_stack へ push する(pending_label と同じ軽量な方式)。

§ce_upgrade_target: Option<usize>

昇格中のカスタム要素(construct_object がこの要素を this にする)。

§ce_processing: bool

カスタム要素の反応を処理中か(再入防止)。

§ce_stack: Vec<(usize, Value)>

構築中のカスタム要素(要素の添字, new.target)。

§dom_builtin_lookup: bool

次の dom_element_get を組込みメンバだけに限る(dom_builtin_get が立てる)。

§new_target_stack: Vec<Value>

new.target(MetaProperty)の現在値のスタック。関数呼び出しごとに (アロー関数を除き)push/pop する。空なら(モジュールトップレベル等)undefined。

§call_names: Vec<String>

呼び出し中の関数名(外側から順)。例外の stack に at 名前 として積む (2026-09-26。従来は Error: メッセージ の 1 行だけで、どこで起きたか分からなかった)。

§tmp_bodies: Vec<Option<Rc<FnBody>>>

Implementations§

Source§

impl Interp

Source

pub(crate) fn tick(&mut self) -> bool

ステップを 1 消費。予算切れなら true(中断)。

Source

fn log_progress(&self, what: &str)

Source

pub fn error(&self, msg: impl Into<String>) -> Value

ビルトインから使う public な例外生成。

Source

pub fn type_error(&self, msg: impl Into<String>) -> Value

it.error()と同じだがError.prototypeではなくTypeError.prototypeへ proto を繋ぐ(name文字列を"TypeError"へ書き換えるだけでは instanceof TypeErrorが満たされない、new Node()等が投げる “Illegal constructor” 例外で発覚したバグの修正用に新設。 2026-07-18 発見・実装)。

Source

pub fn range_error(&self, msg: impl Into<String>) -> Value

RangeError(呼び出しが深すぎる等)。

Source

fn error_of_kind(&self, kind: &str, msg: impl Into<String>) -> Value

kind(TypeError・RangeError 等)の例外オブジェクト(proto もその種類へ繋ぐ)。

Source

pub(crate) fn throw(&self, msg: impl Into<String>) -> Value

Source

pub(crate) fn eval_source(&mut self, source: &str) -> Result<Value, Value>

グローバル eval(source) / Function(...) の実体。仕様上 direct eval は呼び出し元の レキシカルスコープを見るが、この処理系は常にグローバルスコープで実行する簡略実装 (indirect eval (0,eval)(code) と同じセマンティクス)。

Source

pub(crate) fn exec_statements( &mut self, stmts: &[Statement], scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Completion, Value>

Source

pub(crate) fn exec_stmt( &mut self, stmt: &Statement, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Completion, Value>

Source

pub(crate) fn record_export( &mut self, scope: &Rc<RefCell<Scope>>, name: &str, val: Value, )

現在評価中モジュールの export マップにエントリを記録する。 モジュール文脈でない(通常スクリプト)の場合は無視する。

Source

pub(crate) fn load_module( &mut self, specifier: &str, ) -> Result<Rc<RefCell<BTreeMap<String, Value>>>, Value>

指定子のモジュールを(必要なら)評価し、export マップを返す。 循環 import に備え、評価開始前に空マップをレジストリへ入れておく。

Source§

impl Interp

Source

pub(crate) fn iterate_values(&mut self, obj: &Value, of: bool) -> Vec<Value>

for-in / for-of の列挙対象を Value のリストへ。 generator は遅延駆動するため &mut self が必要。

Source

pub(crate) fn is_suspending(&self) -> bool

現在 generator 本体の中断処理中か(suspend 番兵 Err を try/catch が 捕捉しないようにするためのガード)。

Source

pub(crate) fn is_gen_returning(&self) -> bool

現在 generator が強制Returnによる巻き戻し中か。

Source

pub(crate) fn do_yield(&mut self, value: Value) -> Result<Value, Value>

yield value の評価。replay 中でなければ無効(undefined)。 target 番目の yield に達したら中断(suspend 番兵 Err を返す)。 既に通過済みの yield には保存済み resume 値を返して続行する。

Source

pub fn generator_resume( &mut self, state: &Rc<RefCell<GenState>>, sent: Value, ) -> Result<(Value, bool), Value>

Generator を 1 ステップ進める(.next(sent) 相当)。 戻り値は (value, done)。replay 方式で本体を先頭から再実行し、 次の yield まで進めて中断するか、本体完了で done:true を返す。

Source

pub fn generator_throw( &mut self, state: &Rc<RefCell<GenState>>, err: Value, ) -> Result<(Value, bool), Value>

.throw(err) 相当: 現在中断中の yield 式の位置で err を投げて generator を 再開する(generator 本体の try/catch で捕捉されなければ、そのまま呼び出し元へ 伝播する)。

Source

pub fn generator_return( &mut self, state: &Rc<RefCell<GenState>>, val: Value, ) -> Result<(Value, bool), Value>

.return(val) 相当: 現在中断中の yield 式の位置で return を発生させ、 try…finally ブロック等を実行して generator を再開・完了させる。

Source

pub(crate) fn generator_resume_inner( &mut self, state: &Rc<RefCell<GenState>>, sent: GenCompletion, ) -> Result<(Value, bool), Value>

Source

pub(crate) fn drain_generator(&mut self, gen: &ObjRef) -> Vec<Value>

Generator を最後まで駆動して yield 値を Vec に集める(for-of / spread 用)。 無限 generator はステップ予算超過(aborted)で打ち切られる。

Source

pub fn iter_to_vec(&mut self, v: &Value) -> Vec<Value>

イテラブルを Value 列に展開する。generator は遅延駆動する。 iterable_values(純関数)の generator 対応版。

Source§

impl Interp

Source

pub fn eval( &mut self, expr: &Expression, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Value, Value>

Source

pub(crate) fn make_function( &self, name: Option<String>, params: Rc<Vec<Param>>, body: Rc<FnBody>, is_arrow: bool, is_async: bool, is_generator: bool, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Value

Source

pub(crate) fn bind_pattern( &mut self, pat: &Pattern, value: Value, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<(), Value>

分割代入パターンへ値を束縛する(var 宣言・引数・for-of 共通)。

Source

pub(crate) fn eval_class( &mut self, name: &Option<String>, superclass: &Option<Box<Expression>>, members: &[ClassMember], scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Value, Value>

class を評価し、コンストラクタ関数(prototype・静的メンバ・super 連携付き)を返す。

Source

pub(crate) fn super_ctor( &mut self, scope: &Rc<RefCell<Scope>>, ) -> Result<Value, Value>

現在のスコープから基底クラスのコンストラクタを取得。

Source

pub(crate) fn super_proto( &mut self, scope: &Rc<RefCell<Scope>>, ) -> Result<Value, Value>

基底クラスの prototype を取得。

Source§

impl Interp

Source

pub fn promise_resolve( &mut self, state: &Rc<RefCell<PromiseState>>, value: Value, )

Promise を解決する。値が Promise/thenable なら採用(チェーン)する。

Source

pub fn promise_reject( &mut self, state: &Rc<RefCell<PromiseState>>, reason: Value, )

Promise を拒否する。

Source

pub fn promise_then( &mut self, state: &Rc<RefCell<PromiseState>>, on_fulfilled: Option<Value>, on_rejected: Option<Value>, ) -> Value

then 反応を登録し、派生 Promise を返す。

Source

pub(crate) fn schedule_reaction( &self, reaction: &Reaction, value: Value, is_fulfill: bool, )

Source

pub(crate) fn run_one_microtask(&mut self) -> bool

マイクロタスクを 1 つ実行。実行したら true。

Source

pub fn run_microtasks(&mut self)

保留中のマイクロタスクを全て消化する。

Source

pub(crate) fn timer_now(&self) -> u64

setTimeout コールバック(マクロタスク)を 1 つ実行。実行したら true。 タイマー用の現在時刻(ミリ秒。実時刻 + 試験用の早送り分)。

Source

pub(crate) fn run_timer(&mut self, force: bool) -> bool

タイマーを 1 つ実行する。force なら期限前でも最も早いものを実行する(同期 await の進行用)。 期限の早い順、同じなら登録順。setInterval は呼ぶ前に次の予定を積み直す(コールバック内の clearInterval で消せるように)。実行したら true。

Source

pub(crate) fn run_one_macrotask(&mut self) -> bool

互換: 期限の来たタイマーを 1 つ実行する。

Source

pub fn has_due_timer(&self) -> bool

期限の来たタイマーがあるか。

Source

pub fn run_event_loop_for(&mut self, budget_ms: u64)

イベントループ: マイクロタスクを消化 → 期限の来たタイマー 1 つ → 繰り返す。 budget_ms を使い切るか期限の来たタイマーが無くなれば戻る(残りは次の呼び出しで)。

Source

pub fn run_event_loop(&mut self)

スクリプト評価直後のイベントループ(期限の来たタイマーを最大 300ms 分)。

Source

pub(crate) fn chain_suppressed( &mut self, prev: Option<Value>, new_err: Value, ) -> Value

await: 値が Promise ならマイクロタスクを駆動して解決まで進め、値を返す(reject は throw)。 using の複数 dispose が例外を投げた場合に、新しい例外(new_err)と既存の 保留中の例外(prev)を SuppressedError へ集約する。prev が無ければ new_err を そのまま返す(グローバルに SuppressedError が無い異常系でも new_err へ安全にフォールバック)。

Source

pub(crate) fn await_value(&mut self, v: Value) -> Result<Value, Value>

Source§

impl Interp

Source

pub(crate) fn eval_unary( &mut self, op: &UnaryOp, expr: &Expression, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Value, Value>

Source

pub(crate) fn eval_delete( &mut self, expr: &Expression, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Value, Value>

delete expr の実装。expr がプロパティアクセス(obj.x/obj[x])なら 実際にプロパティを取り除いて true を返す。それ以外(変数・リテラル等)は 仕様上ほぼ no-op のため副作用なく true を返す(configurable:false 相当の 「削除できず false」ケースはこの処理系にはプロパティ属性の概念が無いため非対応)。

Source

pub(crate) fn delete_property( &mut self, obj: &Value, property: &str, ) -> Result<Value, Value>

delete obj.prop/delete obj[key] の共通実装(Member/Index 両方から使う)。 以前は Member 経由でしか dataset/style/storage Host プロキシの特別扱いが 効かず、delete element.style['color'] のような Index 経由の等価な書き方だと 何も削除されないバグがあった。

Source

pub(crate) fn eval_update( &mut self, op: &str, prefix: bool, target: &Expression, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Value, Value>

Source

pub(crate) fn eval_assign( &mut self, op: &str, target: &Expression, value: &Expression, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Value, Value>

Source

pub(crate) fn assign_to( &mut self, target: &Expression, val: Value, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<(), Value>

代入先(識別子・メンバ・添字)へ値を書き込む。

Source

pub(crate) fn to_primitive( &mut self, v: Value, hint: &str, ) -> Result<Value, Value>

ToPrimitive(ECMA-262 7.1.1)。原型の連鎖に利用者定義の Symbol.toPrimitive・toString・ valueOf があるときだけ呼ぶ(無ければ値をそのまま返し、従来の組込みの変換に任せる)。 hint は “string”・“number”・“default”。 【2026-10-20】String(obj)・obj + ''・テンプレート文字列・XHR の URL が利用者定義の toString を呼ばず [object Object] になっていた(YouTube の TrustedResourceUrl 相当の URL オブジェクトで GET /[object Object] を送っていた)。

Source

pub(crate) fn to_string_value(&mut self, v: Value) -> Result<String, Value>

ToString(利用者定義の toString を考慮)。

Source

pub fn eval_binary( &mut self, op: &BinaryOp, l: Value, r: Value, ) -> Result<Value, Value>

Source

pub(crate) fn get_dom_node_proto(&self, node_idx: usize) -> Option<ObjRef>

DOM ノードのタグ名または種別から、動的に対応する HTMLXxxElement.prototype (または HTMLElement.prototype / Element.prototype / Node.prototype)を解決する。

Source

pub(crate) fn instance_of( &mut self, l: &Value, r: &Value, ) -> Result<Value, Value>

l instanceof r: r.prototype を起点に l のプロトタイプ連鎖を辿って一致を探す (OrdinaryHasInstance の簡略実装。Symbol.hasInstance によるカスタマイズは非対応)。

Source

pub(crate) fn eval_binary_bigint( &mut self, op: &BinaryOp, l: Value, r: Value, ) -> Result<Value, Value>

BigInt が絡む二項演算。BigInt 同士は任意精度演算、BigInt と Number の 混在は算術・ビット演算で TypeError。等価・大小比較は数値として許容する。

Source

pub(crate) fn bigint_loose_eq(&self, l: &Value, r: &Value) -> bool

BigInt を含む緩い等価比較(BigInt↔Number/String を数値として比較)。

Source

pub(crate) fn bigint_compare( &self, op: &BinaryOp, l: &Value, r: &Value, ) -> Value

BigInt を含む大小比較(BigInt↔Number は f64 経由)。

Source§

impl Interp

Source

pub(crate) fn eval_call( &mut self, callee: &Expression, arguments: &[Expression], optional: bool, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Value, Value>

Source

pub(crate) fn resolve_callee( &mut self, callee: &Expression, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<(Value, Value, bool), Value>

Call の callee を this 束縛込みで解決する(super/super.method は呼出元 eval_call で先に処理済みのためここには来ない)。戻り値は (関数, call_this, 途中で ?. 短絡したか)。object/callee 側は eval_chain_object を再帰的に使うため、a?.b.c() のように途中で短絡した場合は 以降のプロパティアクセス/引数評価/呼出を一切行わずチェーン全体が undefined になる (ECMA-262 の OptionalChain セマンティクス。以前は最初の ?. の直近1段しか 短絡せず、後続のアクセスで TypeError になっていた)。

Source

pub(crate) fn eval_chain_object( &mut self, expr: &Expression, scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<(Value, bool), Value>

Member/Index/Call の「object/callee」位置を短絡込みで評価する。戻り値の bool は「このサブチェーンのどこかで ?. が短絡したか」。短絡時、値は常に Value::Undefined。グローバルな可変フラグではなく戻り値だけで伝播するため、 無関係な式の評価に短絡状態が漏れることが無い。super/super.method を含む Call は短絡セマンティクス対象外のため既存の eval_call にそのまま委譲する。

Source

pub(crate) fn eval_arguments( &mut self, arguments: &[Expression], scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Vec<Value>, Value>

呼出引数を評価し、スプレッド ...x を展開した Vec を返す。

Source

pub(crate) fn eval_new( &mut self, callee: &Expression, arguments: &[Expression], scope: &Rc<RefCell<Scope>>, this: &Value, ) -> Result<Value, Value>

Source

pub fn construct_value( &mut self, func: &Value, args: &[Value], ) -> Result<Value, Value>

new の本体: インスタンスを生成しコンストラクタを呼ぶ。

Source

pub(crate) fn construct_object( &mut self, func: &Value, args: &[Value], ) -> Result<Value, Value>

Source

pub(crate) fn construct_with_target( &mut self, func: &Value, args: &[Value], new_target: &Value, ) -> Result<Value, Value>

new / Reflect.construct(func, args, new_target)。インスタンスの原型は new_target.prototype(仕様の OrdinaryCreateFromConstructor)。

Source

pub fn call_value( &mut self, func: &Value, this: Value, args: &[Value], ) -> Result<Value, Value>

関数値を呼び出す。

Source

pub fn call_listener( &mut self, func: &Value, this: Value, args: &[Value], context: &str, ) -> bool

イベントリスナ・タイマコールバック・オブザーバ通知など、 呼び出し元へ例外を返せない場所からの関数呼び出し。

【2026-07-28】これらは従来 let _ = self.call_value(...) と書かれており、 ハンドラ内で投げられた例外はコンソールにもログにも現れず完全に消えていた (「ボタンを押しても何も起きない」だけが症状として残る)。ブラウザ同様、 捕捉されなかった例外は必ず報告する。

Source

pub fn report_uncaught(&mut self, context: &str, thrown: &Value)

捕捉されなかった例外を、ページのコンソール出力とシリアルログの両方へ出す。

Source

pub fn dispatch_event_in_interp( &mut self, node_idx: usize, event_type: &str, extra: &[(String, Value)], ) -> (bool, bool)

element.dispatchEvent から呼ぶ Interp 内ディスパッチ。JsRuntime 版と同じ capture→target→bubble の3フェーズ・once・stopPropagation を再現するが、 リスナは self.call_value で同一 Interp 上で実行する。戻り値: (発火したか, defaultPrevented)。

Source

fn fire_document_listeners( &mut self, ev: &ObjRef, event_type: &str, want_capture: bool, ) -> (bool, bool)

documentの_listeners[event_type]のうちcaptureフラグがwant_capture と一致するリスナを発火する。documentはself.dom.nodesの一員では なくDOMの祖先チェーンpathに含まれないため、キャプチャ方向では 最も外側、バブル方向では最後の仮想的な祖先としてdispatch_event_ in_interpの冒頭(キャプチャ)と末尾(バブル)から呼ばれる (2026-07-16新設。event_target_dispatch_eventの発火ループと同型の ロジックだが、document用にターゲット/フェーズ番号を差し替えている)。 戻り値は (1件でも発火したか, stopPropagation/stopImmediatePropagation で打ち切られたか)。

Source

pub(crate) fn call_value_inner( &mut self, func: &Value, this: Value, args: &[Value], ) -> Result<Value, Value>

Source

pub(crate) fn call_user_function( &mut self, fd: FunctionData, this: Value, args: &[Value], callee: Value, ) -> Result<Value, Value>

Source§

impl Interp

Source

pub(crate) fn has_property_chain(&self, o: &ObjRef, key: &str) -> bool

key in obj 用: 自身 props → プロトタイプ連鎖を辿って存在判定。 配列の length / 数値インデックスも考慮する。

Source

pub(crate) fn is_window_obj(&self, o: &ObjRef) -> bool

o がグローバルオブジェクト(window)か。

Source

pub(crate) fn media_status(&self, idx: usize) -> Option<PlaybackStatus>

<video>/<audio> が再生スレッドの対象(src が一致)なら、その再生状態。

Source

pub(crate) fn media_source_duration(&self, src: &str) -> Option<f64>

MSE の要素の長さ(秒): JS が設定した mediaSource.duration、無ければ buffered の終わり。

Source

pub(crate) fn resolve_url_against_page(&self, raw: &str) -> String

href/src/action IDL プロパティ用: 現在のページURL基準で相対URLを 絶対URLへ解決する(JsRuntime::new_interp の base_url 解決と同じ真実源)。

Source

pub fn get_property_of_expr( &mut self, recv: &Value, key: &str, obj_expr: &Expression, ) -> Result<Value, Value>

recv.key を読む。recv が undefined/null のときの例外に、その値を生んだ式 (obj_expr)を stack の先頭行の直後へ添える(2026-09-26。どの式が undefined だったか分からず、ミニファイされたライブラリの不具合を追えなかった)。

Source

pub fn get_property(&mut self, recv: &Value, key: &str) -> Result<Value, Value>

Source

pub fn set_property(&mut self, recv: &Value, key: &str, val: Value)

Source§

impl Interp

Source

pub(crate) fn dom_get_property(&mut self, disp: DomDisp, key: &str) -> Value

Source

pub(crate) fn dom_builtin_get(&mut self, idx: usize, key: &str) -> Value

要素の組込みメンバだけを引く(expando・カスタム要素のクラスを見ない)。 Element.prototype.setAttribute 等の転送用ネイティブが使う。

Source

pub(crate) fn dom_builtin_set(&mut self, idx: usize, key: &str, val: Value)

要素の組込みプロパティに書く(クラスの setter を経由しない)。

Source

fn dom_proto_override(&mut self, idx: usize, key: &str) -> Option<Value>

要素の原型連鎖に JS が定義した上書き(ネイティブでない関数・getter)があれば返す。 【2026-10-20】YouTube は Node.prototype.appendChild 等を JS で包み、挿入時に monomer 部品の接続処理を呼ぶ(usePatchedLifecycles)。組込みが先だと包みが効かず、 ytd-page-manager が接続されないまま視聴ページが描かれなかった。

Source

fn ce_chain_get(&mut self, idx: usize, key: &str) -> Option<Value>

昇格したカスタム要素のクラスの原型連鎖から key を引く(無ければ None)。

Source

pub(crate) fn dom_element_get(&mut self, idx: usize, key: &str) -> Value

Source

fn dom_proto_chain_get(&mut self, idx: usize, key: &str) -> Value

DOM 要素の原型の連鎖から key を引く(無ければ undefined)。

Source

pub(crate) fn dom_set_property(&mut self, disp: DomDisp, key: &str, val: Value)

Source§

impl Interp

Source

fn ce_registry(&self) -> Option<ObjRef>

customElements の登録表(名前 → コンストラクタ)。

Source

pub(crate) fn ce_ctor_for(&self, tag: &str) -> Option<Value>

要素名 tag に定義されたコンストラクタ。

Source

fn ce_name_for_ctor(&self, func: &Value) -> Option<String>

コンストラクタ func を登録した要素名。

Source

pub(crate) fn element_class_proto(&self, func: &Value) -> Option<ObjRef>

func.prototype の連鎖が HTMLElement.prototype に届くか(カスタム要素のクラスか)。

Source

pub(crate) fn ce_construct_target( &mut self, new_target: &Value, proto: ObjRef, ) -> Result<(usize, bool), Value>

カスタム要素のクラスの new: this にする DOM 要素の添字を決め、原型を付ける。 戻り値の bool は新しく構築を始めたか(構築スタックに積むか)。

  • 構築中の要素と同じ new.target の入れ子の構築(ES5 版の Reflect.construct(HTMLElement, [], this.constructor))は、同じ要素を返す(仕様の構築スタック)。
  • 昇格中ならその要素、そうでなければ new.target の登録名で要素を作る(未登録なら TypeError)。
Source

pub(crate) fn ce_try_upgrade(&mut self, idx: usize, connected: bool) -> bool

要素 idx を(定義があり、未昇格なら)昇格する。connected なら connectedCallback も呼ぶ。 昇格したら true。

Source

fn ce_callback(&mut self, idx: usize, name: &str)

昇格済みのカスタム要素のライフサイクル関数を呼ぶ(無ければ何もしない)。

Source

pub(crate) fn process_ce_reactions(&mut self)

溜まったカスタム要素の反応を処理する(DOM を変える呼び出しの後に呼ぶ)。

Auto Trait Implementations§

§

impl !RefUnwindSafe for Interp

§

impl !Send for Interp

§

impl !Sync for Interp

§

impl !UnwindSafe for Interp

§

impl Freeze for Interp

§

impl Unpin for Interp

§

impl UnsafeUnpin for Interp

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.