mirror of
https://github.com/servo/servo.git
synced 2025-06-10 17:43:16 +00:00
Return the highest priority error from the descendant instead of return the very first one
This commit is contained in:
parent
2a594821ba
commit
33988cd8aa
2 changed files with 4 additions and 7 deletions
|
@ -633,6 +633,7 @@ impl ModuleTree {
|
|||
}
|
||||
|
||||
// 5-6.
|
||||
let mut errors: Vec<ModuleError> = Vec::new();
|
||||
let descendant_urls = module_tree.get_descendant_urls().borrow();
|
||||
|
||||
for descendant_module in descendant_urls
|
||||
|
@ -650,13 +651,13 @@ impl ModuleTree {
|
|||
ModuleTree::find_first_parse_error(&global, &descendant_module, discovered_urls);
|
||||
|
||||
// 8-4.
|
||||
if child_parse_error.is_some() {
|
||||
return child_parse_error;
|
||||
if let Some(child_error) = child_parse_error {
|
||||
errors.push(child_error);
|
||||
}
|
||||
}
|
||||
|
||||
// Step 9.
|
||||
return None;
|
||||
return errors.into_iter().max();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue