diff options
Diffstat (limited to 'components/script/dom/broadcastchannel.rs')
-rw-r--r-- | components/script/dom/broadcastchannel.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/components/script/dom/broadcastchannel.rs b/components/script/dom/broadcastchannel.rs index 57aa572e652..17c56827fcb 100644 --- a/components/script/dom/broadcastchannel.rs +++ b/components/script/dom/broadcastchannel.rs @@ -12,7 +12,7 @@ use crate::dom::eventtarget::EventTarget; use crate::dom::globalscope::GlobalScope; use crate::script_runtime::JSContext as SafeJSContext; use dom_struct::dom_struct; -use js::rust::{HandleValue, HandleObject}; +use js::rust::{HandleObject, HandleValue}; use script_traits::BroadcastMsg; use std::cell::Cell; use uuid::Uuid; @@ -28,12 +28,24 @@ pub struct BroadcastChannel { impl BroadcastChannel { /// <https://html.spec.whatwg.org/multipage/#broadcastchannel> #[allow(non_snake_case)] - pub fn Constructor(global: &GlobalScope, proto: Option<HandleObject>, name: DOMString) -> DomRoot<BroadcastChannel> { + pub fn Constructor( + global: &GlobalScope, + proto: Option<HandleObject>, + name: DOMString, + ) -> DomRoot<BroadcastChannel> { BroadcastChannel::new(global, proto, name) } - fn new(global: &GlobalScope, proto: Option<HandleObject>, name: DOMString) -> DomRoot<BroadcastChannel> { - let channel = reflect_dom_object2(Box::new(BroadcastChannel::new_inherited(name)), global, proto); + fn new( + global: &GlobalScope, + proto: Option<HandleObject>, + name: DOMString, + ) -> DomRoot<BroadcastChannel> { + let channel = reflect_dom_object2( + Box::new(BroadcastChannel::new_inherited(name)), + global, + proto, + ); global.track_broadcast_channel(&*channel); channel } |