mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Remove JS::from_rooted
This commit is contained in:
parent
134fd18767
commit
b45f1918d1
14 changed files with 24 additions and 33 deletions
|
@ -76,15 +76,6 @@ impl<T> JS<T> {
|
|||
}
|
||||
|
||||
impl<T: Reflectable> JS<T> {
|
||||
/// Create a JS<T> from a Root<T>
|
||||
/// XXX Not a great API. Should be a call on Root<T> instead
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn from_rooted(root: &Root<T>) -> JS<T> {
|
||||
debug_assert!(thread_state::get().is_script());
|
||||
JS {
|
||||
ptr: unsafe { NonZero::new(&**root) },
|
||||
}
|
||||
}
|
||||
/// Create a JS<T> from a &T
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn from_ref(obj: &T) -> JS<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue