mirror of
https://github.com/lexmount/moli.git
synced 2026-11-21 00:03:15 +00:00
Own callback microtask nesting in with_webidl_callback_contexts so operation lookup, invocation, and return conversion share one boundary. Exit the incumbent scope before Scoped-policy checkpoints and preserve Auto timing. Route scripts, functions, modules, and constructors through named renderer entry points, including worker execution. Keep the generic scope helper private and remove manual callback wrappers from callers. Cover microtask policies, exception cleanup, and incumbent cleanup ordering with regression tests. Guard script and module execution entry points with the existing source inventory checks. Validation: - cargo fmt --all - cargo clippy --workspace --all-targets --all-features -- -D warnings - cargo nextest run --no-fail-fast
32 lines
1.2 KiB
Rust
32 lines
1.2 KiB
Rust
//! V8-backed Web IDL callback ownership and invocation primitives.
|
|
//!
|
|
//! This crate owns the engine-level facts that are independent of a particular
|
|
//! DOM target or browser lifecycle:
|
|
//!
|
|
//! - the original callback object;
|
|
//! - its relevant and incumbent V8 contexts;
|
|
//! - the `IsCallable` result captured during Web IDL conversion;
|
|
//! - relevant/incumbent context entry and microtask nesting during invocation;
|
|
//! - function versus callback-interface invocation semantics.
|
|
//!
|
|
//! It deliberately does not own EventTarget registration order, Page/Document
|
|
//! currentness, `window.event`, exception routing, or callback retirement.
|
|
//! Those responsibilities require the renderer's exact owner model and remain
|
|
//! in `moli-renderer-v8`.
|
|
|
|
mod callback_function;
|
|
mod callback_interface;
|
|
mod invocation;
|
|
|
|
pub use callback_function::{PreparedWebIdlCallbackFunction, WebIdlCallbackFunction};
|
|
pub use callback_interface::{PreparedWebIdlCallbackInterface, WebIdlCallbackInterface};
|
|
pub use invocation::{
|
|
WebIdlCallbackInvocation, WebIdlCallbackResolutionFailure, invoke_webidl_callback,
|
|
invoke_webidl_callback_function, with_webidl_callback_contexts,
|
|
};
|
|
|
|
#[cfg(test)]
|
|
mod source_boundary_tests;
|
|
#[cfg(test)]
|
|
mod tests;
|