mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Modify *::get_cx methods to return a safe JSContext instead of a raw one
This commit is contained in:
parent
2c5d0a6ebc
commit
88cacfb009
43 changed files with 306 additions and 321 deletions
|
@ -12,7 +12,7 @@ impl AlreadyInCompartment {
|
|||
#![allow(unsafe_code)]
|
||||
pub fn assert(global: &GlobalScope) -> AlreadyInCompartment {
|
||||
unsafe {
|
||||
assert!(!GetCurrentRealmOrNull(global.get_cx()).is_null());
|
||||
assert!(!GetCurrentRealmOrNull(*global.get_cx()).is_null());
|
||||
}
|
||||
AlreadyInCompartment(())
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ impl<'a> InCompartment<'a> {
|
|||
|
||||
pub fn enter_realm(object: &impl DomObject) -> JSAutoRealm {
|
||||
JSAutoRealm::new(
|
||||
object.global().get_cx(),
|
||||
*object.global().get_cx(),
|
||||
object.reflector().get_jsobject().get(),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue