diff options
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r-- | components/script/dom/macros.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs index 2fd7368525b..b2963305aa6 100644 --- a/components/script/dom/macros.rs +++ b/components/script/dom/macros.rs @@ -614,3 +614,18 @@ macro_rules! impl_performance_entry_struct( } ); ); + +macro_rules! handle_potential_webgl_error { + ($context:expr, $call:expr, $return_on_error:expr) => { + match $call { + Ok(ret) => ret, + Err(error) => { + $context.webgl_error(error); + $return_on_error + } + } + }; + ($context:expr, $call:expr) => { + handle_potential_webgl_error!($context, $call, ()); + }; +} |