diff options
Diffstat (limited to 'components/script/dom/imagedata.rs')
-rw-r--r-- | components/script/dom/imagedata.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs index d3adb0f3f76..220ead847e8 100644 --- a/components/script/dom/imagedata.rs +++ b/components/script/dom/imagedata.rs @@ -28,7 +28,11 @@ pub struct ImageData { impl ImageData { #[allow(unsafe_code)] - pub fn new(global: &GlobalScope, width: u32, height: u32, mut data: Option<Vec<u8>>) -> Root<ImageData> { + pub fn new(global: &GlobalScope, + width: u32, + height: u32, + mut data: Option<Vec<u8>>) + -> Fallible<Root<ImageData>> { let len = width * height * 4; unsafe { let cx = global.get_cx(); @@ -41,7 +45,7 @@ impl ImageData { None => CreateWith::Length(len), }; Uint8ClampedArray::create(cx, data, js_object.handle_mut()).unwrap(); - Self::new_with_jsobject(global, width, Some(height), Some(js_object.get())).unwrap() + Self::new_with_jsobject(global, width, Some(height), Some(js_object.get())) } } |