mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Modify *::get_cx methods to return a safe JSContext instead of a raw one
This commit is contained in:
parent
2c5d0a6ebc
commit
88cacfb009
43 changed files with 306 additions and 321 deletions
|
@ -99,9 +99,9 @@ impl Gamepad {
|
|||
);
|
||||
|
||||
let cx = global.get_cx();
|
||||
rooted!(in (cx) let mut array = ptr::null_mut::<JSObject>());
|
||||
rooted!(in (*cx) let mut array = ptr::null_mut::<JSObject>());
|
||||
unsafe {
|
||||
let _ = Float64Array::create(cx, CreateWith::Slice(&state.axes), array.handle_mut());
|
||||
let _ = Float64Array::create(*cx, CreateWith::Slice(&state.axes), array.handle_mut());
|
||||
}
|
||||
gamepad.axes.set(array.get());
|
||||
|
||||
|
@ -173,7 +173,7 @@ impl Gamepad {
|
|||
self.timestamp.set(state.timestamp);
|
||||
unsafe {
|
||||
let cx = self.global().get_cx();
|
||||
typedarray!(in(cx) let axes: Float64Array = self.axes.get());
|
||||
typedarray!(in(*cx) let axes: Float64Array = self.axes.get());
|
||||
if let Ok(mut array) = axes {
|
||||
array.update(&state.axes);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue