Updated reflect_dom_object to be passed by value

This commit is contained in:
Michael Booth 2014-11-27 20:44:41 +00:00
parent 9cea3ce266
commit 2cbf5a3671
51 changed files with 75 additions and 75 deletions

View file

@ -37,13 +37,13 @@ impl CustomEvent {
}
}
pub fn new_uninitialized(global: &GlobalRef) -> Temporary<CustomEvent> {
pub fn new_uninitialized(global: GlobalRef) -> Temporary<CustomEvent> {
reflect_dom_object(box CustomEvent::new_inherited(CustomEventTypeId),
global,
CustomEventBinding::Wrap)
}
pub fn new(global: &GlobalRef, type_: DOMString, bubbles: bool, cancelable: bool, detail: JSVal) -> Temporary<CustomEvent> {
let ev = CustomEvent::new_uninitialized(global).root();
let ev = CustomEvent::new_uninitialized(*global).root();
ev.InitCustomEvent(global.get_cx(), type_, bubbles, cancelable, detail);
Temporary::from_rooted(*ev)
}