Use safe JSContext when possible in interface.rs

This commit is contained in:
marmeladema 2019-07-27 18:52:12 +01:00
parent 8b070fef52
commit 78034a90d0
6 changed files with 194 additions and 176 deletions

View file

@ -6,7 +6,8 @@
use crate::dom::bindings::guard::Guard;
use crate::dom::bindings::interface::{create_object, define_on_global_object};
use js::jsapi::{JSClass, JSContext, JSFunctionSpec};
use crate::script_runtime::JSContext;
use js::jsapi::{JSClass, JSFunctionSpec};
use js::rust::{HandleObject, MutableHandleObject};
/// The class of a namespace object.
@ -28,8 +29,8 @@ impl NamespaceObjectClass {
}
/// Create a new namespace object.
pub unsafe fn create_namespace_object(
cx: *mut JSContext,
pub fn create_namespace_object(
cx: JSContext,
global: HandleObject,
proto: HandleObject,
class: &'static NamespaceObjectClass,