Move handle_potential_webgl_error to the dom macros module

This commit is contained in:
Anthony Ramine 2018-04-04 12:47:06 +02:00
parent e7f716de12
commit 3c56d2f5a7
2 changed files with 15 additions and 15 deletions

View file

@ -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, ());
};
}