mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix unsafe Heap constructor usage in DOM objects
This commit is contained in:
parent
ed7686b42c
commit
efb59b7ecd
7 changed files with 82 additions and 84 deletions
|
@ -32,9 +32,7 @@ unsafe fn update_or_create_typed_array(cx: *mut JSContext,
|
|||
match src {
|
||||
Some(data) => {
|
||||
if dst.get().is_null() {
|
||||
rooted!(in (cx) let mut array = ptr::null_mut());
|
||||
let _ = Float32Array::create(cx, CreateWith::Slice(data), array.handle_mut());
|
||||
(*dst).set(array.get());
|
||||
let _ = Float32Array::create(cx, CreateWith::Slice(data), dst.handle_mut());
|
||||
} else {
|
||||
typedarray!(in(cx) let array: Float32Array = dst.get());
|
||||
if let Ok(mut array) = array {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue