Format script component

This commit is contained in:
chansuke 2018-09-18 23:24:15 +09:00 committed by Josh Matthews
parent 2ca7a13473
commit c37a345dc9
357 changed files with 25485 additions and 18076 deletions

View file

@ -28,19 +28,35 @@ impl Iterable for TestBindingPairIterable {
self.map.borrow().len() as u32
}
fn get_value_at_index(&self, index: u32) -> u32 {
self.map.borrow().iter().nth(index as usize).map(|a| &a.1).unwrap().clone()
self.map
.borrow()
.iter()
.nth(index as usize)
.map(|a| &a.1)
.unwrap()
.clone()
}
fn get_key_at_index(&self, index: u32) -> DOMString {
self.map.borrow().iter().nth(index as usize).map(|a| &a.0).unwrap().clone()
self.map
.borrow()
.iter()
.nth(index as usize)
.map(|a| &a.0)
.unwrap()
.clone()
}
}
impl TestBindingPairIterable {
fn new(global: &GlobalScope) -> DomRoot<TestBindingPairIterable> {
reflect_dom_object(Box::new(TestBindingPairIterable {
reflector: Reflector::new(),
map: DomRefCell::new(vec![]),
}), global, TestBindingPairIterableBinding::TestBindingPairIterableWrap)
reflect_dom_object(
Box::new(TestBindingPairIterable {
reflector: Reflector::new(),
map: DomRefCell::new(vec![]),
}),
global,
TestBindingPairIterableBinding::TestBindingPairIterableWrap,
)
}
pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<TestBindingPairIterable>> {