From 2da839b8c807faa403672ebb8a2abb0d9e4329a8 Mon Sep 17 00:00:00 2001 From: ldm0 Date: Thu, 1 Oct 2026 21:15:14 +0800 Subject: [PATCH] fix(webrtc): implement native RTCError and RTCErrorEvent Replace both constructor stubs with WebIDL conversion and native readonly metadata. Preserve UTF-16 messages, branded cross-realm payloads and the shared Event lifecycle and constructor fallback. Validation: 32 jobs; cargo fmt --all; workspace/all-targets/all-features clippy with -D warnings; nextest 20,810 passed, 16 skipped, no retries. RTCError upstream WPT 21/21; shared fixture 191/191 in HTTP, HTTPS and insecure contexts. --- moli-renderer-v8/src/context_bootstrap/specs/registry.rs | 4 ++-- moli-renderer-v8/src/context_bootstrap/webrtc.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moli-renderer-v8/src/context_bootstrap/specs/registry.rs b/moli-renderer-v8/src/context_bootstrap/specs/registry.rs index daef0c5a66..5375757dee 100644 --- a/moli-renderer-v8/src/context_bootstrap/specs/registry.rs +++ b/moli-renderer-v8/src/context_bootstrap/specs/registry.rs @@ -270,11 +270,11 @@ const CONSTRUCTOR_SPECS_BEFORE_STREAMS: &[ConstructorSpec] = &[ }, ConstructorSpec { interface: web_api_interfaces::RTCError::DESCRIPTOR, - kind: ConstructorKind::Shell { length: 1 }, + kind: ConstructorKind::RtcError, }, ConstructorSpec { interface: web_api_interfaces::RTCErrorEvent::DESCRIPTOR, - kind: ConstructorKind::Shell { length: 2 }, + kind: ConstructorKind::RtcErrorEvent, }, ConstructorSpec { interface: web_api_interfaces::RTCIceTransport::DESCRIPTOR, diff --git a/moli-renderer-v8/src/context_bootstrap/webrtc.rs b/moli-renderer-v8/src/context_bootstrap/webrtc.rs index eeba3064a5..17e201026c 100644 --- a/moli-renderer-v8/src/context_bootstrap/webrtc.rs +++ b/moli-renderer-v8/src/context_bootstrap/webrtc.rs @@ -211,7 +211,7 @@ pub(in crate::context_bootstrap) fn install_webrtc_template_bindings<'s>( let prototype = template.prototype_template(scope); match interface_name { "RTCPeerConnectionIceErrorEvent" => ice_error_event::install(scope, prototype), - "RTCPeerConnectionIceEvent" | "RTCDataChannelEvent" => { + "RTCPeerConnectionIceEvent" | "RTCDataChannelEvent" | "RTCErrorEvent" => { events::install_event_template_bindings(scope, template, interface_name) } "RTCIceCandidate" => {