diff options
author | marmeladema <xademax@gmail.com> | 2019-07-22 01:09:24 +0100 |
---|---|---|
committer | marmeladema <xademax@gmail.com> | 2019-07-24 08:24:50 +0100 |
commit | 2c5d0a6ebc39ad263e2bbe623e357a11b4cec5aa (patch) | |
tree | c1c93f26ab047bb010d1781511a750a302cc5636 /components/script/dom/customevent.rs | |
parent | 808fa65aef163879b82baddc4af0a5445f806c81 (diff) | |
download | servo-2c5d0a6ebc39ad263e2bbe623e357a11b4cec5aa.tar.gz servo-2c5d0a6ebc39ad263e2bbe623e357a11b4cec5aa.zip |
Convert CGTraitInterface to use safe JSContext instead of raw JSContext
Diffstat (limited to 'components/script/dom/customevent.rs')
-rw-r--r-- | components/script/dom/customevent.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/components/script/dom/customevent.rs b/components/script/dom/customevent.rs index de07a55d4d4..91035f56e03 100644 --- a/components/script/dom/customevent.rs +++ b/components/script/dom/customevent.rs @@ -13,8 +13,9 @@ use crate::dom::bindings::str::DOMString; use crate::dom::bindings::trace::RootedTraceableBox; use crate::dom::event::Event; use crate::dom::globalscope::GlobalScope; +use crate::script_runtime::JSContext; use dom_struct::dom_struct; -use js::jsapi::{Heap, JSContext}; +use js::jsapi::Heap; use js::jsval::JSVal; use js::rust::HandleValue; use servo_atoms::Atom; @@ -87,17 +88,15 @@ impl CustomEvent { } impl CustomEventMethods for CustomEvent { - #[allow(unsafe_code)] // https://dom.spec.whatwg.org/#dom-customevent-detail - unsafe fn Detail(&self, _cx: *mut JSContext) -> JSVal { + fn Detail(&self, _cx: JSContext) -> JSVal { self.detail.get() } - #[allow(unsafe_code)] // https://dom.spec.whatwg.org/#dom-customevent-initcustomevent - unsafe fn InitCustomEvent( + fn InitCustomEvent( &self, - _cx: *mut JSContext, + _cx: JSContext, type_: DOMString, can_bubble: bool, cancelable: bool, |