aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/realms.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2023-02-16 23:09:50 -0500
committerJosh Matthews <josh@joshmatthews.net>2023-05-20 11:05:09 -0400
commitf79e1e327dfdf047cab9652e1cc3e67a7667faa1 (patch)
tree43c1cf48c9a6448264722780e38315dafacf4a24 /components/script/realms.rs
parent4998c65c423f995149f4b314d8ff68024c24cc72 (diff)
downloadservo-f79e1e327dfdf047cab9652e1cc3e67a7667faa1.tar.gz
servo-f79e1e327dfdf047cab9652e1cc3e67a7667faa1.zip
Make GlobalScope.get_cx a static method.
Diffstat (limited to 'components/script/realms.rs')
-rw-r--r--components/script/realms.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/realms.rs b/components/script/realms.rs
index 280e615e412..bc322a2fe6d 100644
--- a/components/script/realms.rs
+++ b/components/script/realms.rs
@@ -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(),
)
}