Skip to content

Commit

Permalink
Add a static from_rooted method to JS<T> #2309
Browse files Browse the repository at this point in the history
  • Loading branch information
ebalint committed Jun 2, 2014
1 parent 59cef94 commit 7910eb1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/script/dom/bindings/js.rs
Expand Up @@ -166,6 +166,14 @@ impl<T: Reflectable> JS<T> {
}
}

impl<T: Assignable<U>, U: Reflectable> JS<U> {
pub fn from_rooted(root: T) -> JS<U> {
unsafe {
root.get_js()
}
}
}

//XXXjdm This is disappointing. This only gets called from trace hooks, in theory,
// so it's safe to assume that self is rooted and thereby safe to access.
impl<T: Reflectable> Reflectable for JS<T> {
Expand Down

5 comments on commit 7910eb1

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from Ms2ger
at ebalint@7910eb1

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging ebalint/servo/master = 7910eb1 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ebalint/servo/master = 7910eb1 merged ok, testing candidate = 8c73f25

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 8c73f25

Please sign in to comment.