aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/htmlconstructor.rs
diff options
context:
space:
mode:
authormarmeladema <xademax@gmail.com>2019-07-27 17:48:21 +0100
committermarmeladema <xademax@gmail.com>2019-08-09 00:02:10 +0100
commit8b070fef526bf8c1470c9c82ae2431067b2da4ff (patch)
treeaced7221ad302ccb36d87745a0a318b513e8ada4 /components/script/dom/bindings/htmlconstructor.rs
parent6d444afd9e3ff4bdfb8a814ecee1d6d39f283439 (diff)
downloadservo-8b070fef526bf8c1470c9c82ae2431067b2da4ff.tar.gz
servo-8b070fef526bf8c1470c9c82ae2431067b2da4ff.zip
Use safe JSContext in get_constructor_object_from_local_name
Diffstat (limited to 'components/script/dom/bindings/htmlconstructor.rs')
-rw-r--r--components/script/dom/bindings/htmlconstructor.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/bindings/htmlconstructor.rs b/components/script/dom/bindings/htmlconstructor.rs
index 6faa4f6211c..40aad6324b6 100644
--- a/components/script/dom/bindings/htmlconstructor.rs
+++ b/components/script/dom/bindings/htmlconstructor.rs
@@ -76,13 +76,13 @@ use crate::dom::customelementregistry::{ConstructionStackEntry, CustomElementSta
use crate::dom::element::{Element, ElementCreator};
use crate::dom::htmlelement::HTMLElement;
use crate::dom::window::Window;
-use crate::script_runtime::JSContext as SafeJSContext;
+use crate::script_runtime::JSContext;
use crate::script_thread::ScriptThread;
use html5ever::interface::QualName;
use html5ever::LocalName;
use js::glue::UnwrapObjectStatic;
use js::jsapi::{CallArgs, CurrentGlobalOrNull};
-use js::jsapi::{JSAutoRealm, JSContext, JSObject};
+use js::jsapi::{JSAutoRealm, JSObject};
use js::rust::HandleObject;
use js::rust::MutableHandleObject;
use std::ptr;
@@ -134,7 +134,7 @@ where
// Step 5
get_constructor_object_from_local_name(
definition.local_name.clone(),
- *window.get_cx(),
+ window.get_cx(),
global_object.handle(),
constructor.handle_mut(),
);
@@ -196,13 +196,13 @@ where
/// This list should only include elements marked with the [HTMLConstructor] extended attribute.
pub fn get_constructor_object_from_local_name(
name: LocalName,
- cx: *mut JSContext,
+ cx: JSContext,
global: HandleObject,
rval: MutableHandleObject,
) -> bool {
macro_rules! get_constructor(
($binding:ident) => ({
- unsafe { $binding::GetConstructorObject(SafeJSContext::from_ptr(cx), global, rval); }
+ unsafe { $binding::GetConstructorObject(cx, global, rval); }
true
})
);