mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Use throw_type_error and throw_range_error from js.
This commit is contained in:
parent
ddaa1a1960
commit
acb24e80b8
5 changed files with 24 additions and 92 deletions
|
@ -157,6 +157,7 @@ impl HTMLCanvasElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn get_or_init_webgl_context(&self,
|
||||
cx: *mut JSContext,
|
||||
attrs: Option<HandleValue>) -> Option<Root<WebGLRenderingContext>> {
|
||||
|
@ -165,7 +166,7 @@ impl HTMLCanvasElement {
|
|||
let size = self.get_size();
|
||||
|
||||
let attrs = if let Some(webgl_attributes) = attrs {
|
||||
if let Ok(ref attrs) = WebGLContextAttributes::new(cx, webgl_attributes) {
|
||||
if let Ok(ref attrs) = unsafe { WebGLContextAttributes::new(cx, webgl_attributes) } {
|
||||
From::from(attrs)
|
||||
} else {
|
||||
debug!("Unexpected error on conversion of WebGLContextAttributes");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue