Modify *::get_cx methods to return a safe JSContext instead of a raw one

This commit is contained in:
marmeladema 2019-07-22 22:14:11 +01:00
parent 2c5d0a6ebc
commit 88cacfb009
43 changed files with 306 additions and 321 deletions

View file

@ -40,7 +40,6 @@ impl XRView {
}
}
#[allow(unsafe_code)]
pub fn new<V: Copy>(
global: &GlobalScope,
session: &XRSession,
@ -65,7 +64,7 @@ impl XRView {
// row_major since euclid uses row vectors
let proj = view.projection.to_row_major_array();
let cx = unsafe { JSContext::from_ptr(global.get_cx()) };
let cx = global.get_cx();
create_typed_array(cx, &proj, &ret.proj);
ret
}