aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/js.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-02-11 21:05:03 +0100
committerMs2ger <ms2ger@gmail.com>2015-02-12 20:59:22 +0100
commitb3f93b25a58eae456b27ea15423feb5181ab9aa1 (patch)
treeae4e7bffb5f737f25aa0b1ca8d7f419953c1776f /components/script/dom/bindings/js.rs
parent8ab7d37ef26559073ea1b981e70758eb4cd86f68 (diff)
downloadservo-b3f93b25a58eae456b27ea15423feb5181ab9aa1.tar.gz
servo-b3f93b25a58eae456b27ea15423feb5181ab9aa1.zip
Remove JS::unsafe_get.
The codegen users already migrated to Unrooted, and the layout users are better off using LayoutJS.
Diffstat (limited to 'components/script/dom/bindings/js.rs')
-rw-r--r--components/script/dom/bindings/js.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs
index ea4a8af2f56..2abba36b1e1 100644
--- a/components/script/dom/bindings/js.rs
+++ b/components/script/dom/bindings/js.rs
@@ -197,7 +197,7 @@ pub struct JS<T> {
impl<T> JS<T> {
/// Returns `LayoutJS<T>` containing the same pointer.
- fn to_layout(self) -> LayoutJS<T> {
+ pub unsafe fn to_layout(self) -> LayoutJS<T> {
LayoutJS {
ptr: self.ptr.clone()
}
@@ -291,7 +291,7 @@ impl<U: Reflectable> JS<U> {
impl<T: Reflectable> Reflectable for JS<T> {
fn reflector<'a>(&'a self) -> &'a Reflector {
unsafe {
- (*self.unsafe_get()).reflector()
+ (**self.ptr).reflector()
}
}
}
@@ -419,12 +419,6 @@ impl<T: Reflectable> MutNullableJS<T> {
}
impl<T: Reflectable> JS<T> {
- /// Returns an unsafe pointer to the interior of this object.
- /// This should only be used by the DOM bindings.
- pub unsafe fn unsafe_get(&self) -> *const T {
- *self.ptr
- }
-
/// Store an unrooted value in this field. This is safe under the
/// assumption that JS<T> values are only used as fields in DOM types that
/// are reachable in the GC graph, so this unrooted value becomes