auto merge of #2042 : SimonSapin/servo/silence-ua-stylesheet, r=jdm

r? @Ms2ger
This commit is contained in:
bors-servo 2014-04-04 21:01:43 -04:00
commit e3cc46a782

View file

@ -22,7 +22,10 @@ impl<T, I: Iterator<Result<T, SyntaxError>>> Iterator<T> for ErrorLoggerIterator
}
local_data_key!(silence_errors: ())
// FIXME: go back to `()` instead of `bool` after upgrading Rust
// past 898669c4e203ae91e2048fb6c0f8591c867bccc6
// Using bool is a work-around for https://github.com/mozilla/rust/issues/13322
local_data_key!(silence_errors: bool)
pub fn log_css_error(location: SourceLocation, message: &str) {
// TODO eventually this will got into a "web console" or something.
@ -33,7 +36,7 @@ pub fn log_css_error(location: SourceLocation, message: &str) {
pub fn with_errors_silenced<T>(f: || -> T) -> T {
local_data::set(silence_errors, ());
local_data::set(silence_errors, true);
let result = f();
local_data::pop(silence_errors);
result