Fix unsafe Heap constructor usage in DOM objects

This commit is contained in:
Imanol Fernandez 2017-04-17 19:39:22 +02:00
parent ed7686b42c
commit efb59b7ecd
7 changed files with 82 additions and 84 deletions

View file

@ -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 {