aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/gamepad.rs
diff options
context:
space:
mode:
authormarmeladema <xademax@gmail.com>2019-07-22 01:09:24 +0100
committermarmeladema <xademax@gmail.com>2019-07-24 08:24:50 +0100
commit2c5d0a6ebc39ad263e2bbe623e357a11b4cec5aa (patch)
treec1c93f26ab047bb010d1781511a750a302cc5636 /components/script/dom/gamepad.rs
parent808fa65aef163879b82baddc4af0a5445f806c81 (diff)
downloadservo-2c5d0a6ebc39ad263e2bbe623e357a11b4cec5aa.tar.gz
servo-2c5d0a6ebc39ad263e2bbe623e357a11b4cec5aa.zip
Convert CGTraitInterface to use safe JSContext instead of raw JSContext
Diffstat (limited to 'components/script/dom/gamepad.rs')
-rw-r--r--components/script/dom/gamepad.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/gamepad.rs b/components/script/dom/gamepad.rs
index fe86a3b2329..08160bfd3ad 100644
--- a/components/script/dom/gamepad.rs
+++ b/components/script/dom/gamepad.rs
@@ -15,8 +15,9 @@ use crate::dom::gamepadbuttonlist::GamepadButtonList;
use crate::dom::gamepadevent::{GamepadEvent, GamepadEventType};
use crate::dom::globalscope::GlobalScope;
use crate::dom::vrpose::VRPose;
+use crate::script_runtime::JSContext;
use dom_struct::dom_struct;
-use js::jsapi::{Heap, JSContext, JSObject};
+use js::jsapi::{Heap, JSObject};
use js::typedarray::{CreateWith, Float64Array};
use std::cell::Cell;
use std::ptr;
@@ -136,8 +137,8 @@ impl GamepadMethods for Gamepad {
#[allow(unsafe_code)]
// https://w3c.github.io/gamepad/#dom-gamepad-axes
- unsafe fn Axes(&self, _cx: *mut JSContext) -> NonNull<JSObject> {
- NonNull::new_unchecked(self.axes.get())
+ fn Axes(&self, _cx: JSContext) -> NonNull<JSObject> {
+ unsafe { NonNull::new_unchecked(self.axes.get()) }
}
// https://w3c.github.io/gamepad/#dom-gamepad-buttons