Support arbitrary protos when wrapping EventTarget objects.

This commit is contained in:
Josh Matthews 2023-05-25 23:59:02 -04:00
parent 4ee789a85c
commit d9600ff50f
8 changed files with 187 additions and 35 deletions

View file

@ -20,7 +20,7 @@ use dom_struct::dom_struct;
use js::conversions::ToJSValConvertible;
use js::jsapi::{Heap, JSObject};
use js::jsval::UndefinedValue;
use js::rust::{HandleValue, MutableHandleObject};
use js::rust::{HandleValue, MutableHandleObject, HandleObject};
use std::cell::Cell;
use std::ptr;
use std::ptr::NonNull;
@ -118,7 +118,7 @@ impl<T: DomObjectIteratorWrap + JSTraceable + Iterable> IterableIterator<T> {
}
impl<T: DomObjectIteratorWrap + JSTraceable + Iterable> DomObjectWrap for IterableIterator<T> {
const WRAP: unsafe fn(JSContext, &GlobalScope, Box<Self>) -> Root<Dom<Self>> = T::ITER_WRAP;
const WRAP: unsafe fn(JSContext, &GlobalScope, Option<HandleObject>, Box<Self>) -> Root<Dom<Self>> = T::ITER_WRAP;
}
fn dict_return(