mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Format script component
This commit is contained in:
parent
2ca7a13473
commit
c37a345dc9
357 changed files with 25485 additions and 18076 deletions
|
@ -21,10 +21,14 @@ pub struct TestBindingIterable {
|
|||
|
||||
impl TestBindingIterable {
|
||||
fn new(global: &GlobalScope) -> DomRoot<TestBindingIterable> {
|
||||
reflect_dom_object(Box::new(TestBindingIterable {
|
||||
reflector: Reflector::new(),
|
||||
vals: DomRefCell::new(vec![]),
|
||||
}), global, TestBindingIterableBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(TestBindingIterable {
|
||||
reflector: Reflector::new(),
|
||||
vals: DomRefCell::new(vec![]),
|
||||
}),
|
||||
global,
|
||||
TestBindingIterableBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<TestBindingIterable>> {
|
||||
|
@ -33,9 +37,15 @@ impl TestBindingIterable {
|
|||
}
|
||||
|
||||
impl TestBindingIterableMethods for TestBindingIterable {
|
||||
fn Add(&self, v: DOMString) { self.vals.borrow_mut().push(v); }
|
||||
fn Length(&self) -> u32 { self.vals.borrow().len() as u32 }
|
||||
fn GetItem(&self, n: u32) -> DOMString { self.IndexedGetter(n).unwrap_or_default() }
|
||||
fn Add(&self, v: DOMString) {
|
||||
self.vals.borrow_mut().push(v);
|
||||
}
|
||||
fn Length(&self) -> u32 {
|
||||
self.vals.borrow().len() as u32
|
||||
}
|
||||
fn GetItem(&self, n: u32) -> DOMString {
|
||||
self.IndexedGetter(n).unwrap_or_default()
|
||||
}
|
||||
fn IndexedGetter(&self, n: u32) -> Option<DOMString> {
|
||||
self.vals.borrow().get(n as usize).cloned()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue