mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Convert CGTraitInterface to use safe JSContext instead of raw JSContext
This commit is contained in:
parent
808fa65aef
commit
2c5d0a6ebc
43 changed files with 443 additions and 528 deletions
|
@ -405,13 +405,13 @@ impl CustomElementRegistryMethods for CustomElementRegistry {
|
|||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-customelementregistry-get>
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn Get(&self, cx: *mut JSContext, name: DOMString) -> JSVal {
|
||||
fn Get(&self, cx: SafeJSContext, name: DOMString) -> JSVal {
|
||||
match self.definitions.borrow().get(&LocalName::from(&*name)) {
|
||||
Some(definition) => {
|
||||
rooted!(in(cx) let mut constructor = UndefinedValue());
|
||||
Some(definition) => unsafe {
|
||||
rooted!(in(*cx) let mut constructor = UndefinedValue());
|
||||
definition
|
||||
.constructor
|
||||
.to_jsval(cx, constructor.handle_mut());
|
||||
.to_jsval(*cx, constructor.handle_mut());
|
||||
constructor.get()
|
||||
},
|
||||
None => UndefinedValue(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue