Use Cell/RefCell for interior mutability of Attr, AttrList, Blob,

BrowserContext, ClientRect, and ClientRectList.
This commit is contained in:
Tetsuharu OHZEKI 2014-05-28 04:10:54 +09:00
parent 5ae7c4cbb1
commit 46ead90515
3 changed files with 11 additions and 8 deletions

View file

@ -39,11 +39,11 @@ pub trait AttrListMethods {
impl<'a> AttrListMethods for JSRef<'a, AttrList> {
fn Length(&self) -> u32 {
self.owner.root().attrs.len() as u32
self.owner.root().attrs.borrow().len() as u32
}
fn Item(&self, index: u32) -> Option<Temporary<Attr>> {
self.owner.root().attrs.as_slice().get(index as uint).map(|x| Temporary::new(x.clone()))
self.owner.root().attrs.borrow().as_slice().get(index as uint).map(|x| Temporary::new(x.clone()))
}
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Attr>> {