mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Fixes #4164 Make Constructor and new functions take GlobalRef by value
This commit is contained in:
parent
cf616b90a2
commit
85df7f0d6f
25 changed files with 61 additions and 61 deletions
|
@ -40,12 +40,12 @@ impl CustomEvent {
|
|||
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();
|
||||
pub fn new(global: GlobalRef, type_: DOMString, bubbles: bool, cancelable: bool, detail: JSVal) -> Temporary<CustomEvent> {
|
||||
let ev = CustomEvent::new_uninitialized(global).root();
|
||||
ev.r().InitCustomEvent(global.get_cx(), type_, bubbles, cancelable, detail);
|
||||
Temporary::from_rooted(ev.r())
|
||||
}
|
||||
pub fn Constructor(global: &GlobalRef,
|
||||
pub fn Constructor(global: GlobalRef,
|
||||
type_: DOMString,
|
||||
init: &CustomEventBinding::CustomEventInit) -> Fallible<Temporary<CustomEvent>>{
|
||||
Ok(CustomEvent::new(global, type_, init.parent.bubbles, init.parent.cancelable, init.detail))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue