switch to using DOMRefCell<VeqDeque<String>> for ServoParser::pending_input

This commit is contained in:
Gregory 2016-10-16 16:26:34 +08:00
parent 759185abe0
commit f1d0c8b8df
2 changed files with 15 additions and 5 deletions

View file

@ -78,7 +78,7 @@ use serde::{Deserialize, Serialize};
use smallvec::SmallVec;
use std::boxed::FnBox;
use std::cell::{Cell, UnsafeCell};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::collections::{BTreeMap, HashMap, HashSet, VecDeque};
use std::hash::{BuildHasher, Hash};
use std::ops::{Deref, DerefMut};
use std::path::PathBuf;
@ -208,6 +208,15 @@ impl<T: JSTraceable> JSTraceable for Vec<T> {
}
}
impl<T: JSTraceable> JSTraceable for VecDeque<T> {
#[inline]
fn trace(&self, trc: *mut JSTracer) {
for e in &*self {
e.trace(trc);
}
}
}
impl<T: JSTraceable> JSTraceable for (T, T, T, T) {
fn trace(&self, trc: *mut JSTracer) {
self.0.trace(trc);