Make dictionaries contain Root<T> values instead of JS<T>, ensuring that they will not be collected while the dictionary is alive.

This commit is contained in:
Josh Matthews 2014-04-24 11:44:53 -04:00
parent 0f2d0b1dc3
commit 895e9ee37f
5 changed files with 20 additions and 11 deletions

View file

@ -46,9 +46,8 @@ impl UIEvent {
type_: DOMString,
init: &UIEventBinding::UIEventInit) -> Fallible<Temporary<UIEvent>> {
let mut ev = UIEvent::new(owner).root();
let view = init.view.as_ref().map(|view| view.root());
ev.InitUIEvent(type_, init.parent.bubbles, init.parent.cancelable,
view.root_ref(), init.detail);
init.view.root_ref(), init.detail);
Ok(Temporary::from_rooted(&*ev))
}
}