diff --git a/src/context.rs b/src/context.rs index 9e0b05c..44458b9 100644 --- a/src/context.rs +++ b/src/context.rs @@ -31,6 +31,9 @@ impl Context{ ); (Context{dom},crate::runner::instance::Script::new(script_ref),services) } + pub fn from_ref(dom:&WeakDom)->&Context{ + unsafe{&*(dom as *const WeakDom as *const Context)} + } pub fn from_mut(dom:&mut WeakDom)->&mut Context{ unsafe{&mut *(dom as *mut WeakDom as *mut Context)} }