mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Make GlobalScope.get_cx a static method.
This commit is contained in:
parent
4998c65c42
commit
f79e1e327d
39 changed files with 132 additions and 127 deletions
|
@ -11,9 +11,9 @@ pub struct AlreadyInRealm(());
|
|||
|
||||
impl AlreadyInRealm {
|
||||
#![allow(unsafe_code)]
|
||||
pub fn assert(global: &GlobalScope) -> AlreadyInRealm {
|
||||
pub fn assert(_global: &GlobalScope) -> AlreadyInRealm {
|
||||
unsafe {
|
||||
assert!(!GetCurrentRealmOrNull(*global.get_cx()).is_null());
|
||||
assert!(!GetCurrentRealmOrNull(*GlobalScope::get_cx()).is_null());
|
||||
}
|
||||
AlreadyInRealm(())
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ impl<'a> InRealm<'a> {
|
|||
|
||||
pub fn enter_realm(object: &impl DomObject) -> JSAutoRealm {
|
||||
JSAutoRealm::new(
|
||||
*object.global().get_cx(),
|
||||
*GlobalScope::get_cx(),
|
||||
object.reflector().get_jsobject().get(),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue