mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rename JS<T> to Dom<T>
This commit is contained in:
parent
0e3c54c191
commit
7be32fb237
96 changed files with 494 additions and 494 deletions
|
@ -18,9 +18,9 @@
|
|||
//! achieved via `unsafe_no_jsmanaged_fields!` or similar.
|
||||
//! 3. For all fields, `Foo::trace()`
|
||||
//! calls `trace()` on the field.
|
||||
//! For example, for fields of type `JS<T>`, `JS<T>::trace()` calls
|
||||
//! For example, for fields of type `Dom<T>`, `Dom<T>::trace()` calls
|
||||
//! `trace_reflector()`.
|
||||
//! 4. `trace_reflector()` calls `JS::TraceEdge()` with a
|
||||
//! 4. `trace_reflector()` calls `Dom::TraceEdge()` with a
|
||||
//! pointer to the `JSObject` for the reflector. This notifies the GC, which
|
||||
//! will add the object to the graph, and will trace that object as well.
|
||||
//! 5. When the GC finishes tracing, it [`finalizes`](../index.html#destruction)
|
||||
|
@ -42,7 +42,7 @@ use dom::bindings::cell::DOMRefCell;
|
|||
use dom::bindings::error::Error;
|
||||
use dom::bindings::refcounted::{Trusted, TrustedPromise};
|
||||
use dom::bindings::reflector::{DomObject, Reflector};
|
||||
use dom::bindings::root::{JS, Root};
|
||||
use dom::bindings::root::{Dom, Root};
|
||||
use dom::bindings::str::{DOMString, USVString};
|
||||
use dom::bindings::utils::WindowProxyHandler;
|
||||
use dom::document::PendingRestyle;
|
||||
|
@ -840,16 +840,16 @@ impl<'a, T: 'static + JSTraceable> RootedVec<'a, T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, T: 'static + JSTraceable + DomObject> RootedVec<'a, JS<T>> {
|
||||
/// Create a vector of items of type JS<T> that is rooted for
|
||||
impl<'a, T: 'static + JSTraceable + DomObject> RootedVec<'a, Dom<T>> {
|
||||
/// Create a vector of items of type Dom<T> that is rooted for
|
||||
/// the lifetime of this struct
|
||||
pub fn from_iter<I>(root: &'a mut RootableVec<JS<T>>, iter: I) -> Self
|
||||
pub fn from_iter<I>(root: &'a mut RootableVec<Dom<T>>, iter: I) -> Self
|
||||
where I: Iterator<Item = Root<T>>
|
||||
{
|
||||
unsafe {
|
||||
RootedTraceableSet::add(root);
|
||||
}
|
||||
root.v.extend(iter.map(|item| JS::from_ref(&*item)));
|
||||
root.v.extend(iter.map(|item| Dom::from_ref(&*item)));
|
||||
RootedVec {
|
||||
root: root,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue