Various adaptations for Phantomas v2

This commit is contained in:
Gaël Métais
2020-08-11 03:01:43 +02:00
parent bafea756ee
commit e19a521c4e
4 changed files with 60 additions and 47 deletions
+10 -8
View File
@@ -312,7 +312,7 @@ var policies = {
list: offenders.map(function(offender) {
if (offender === '[inline CSS]') {
return {
error: 'Empty style tag',
error: 'Empty <style> tag',
file: null,
line: null,
column: null
@@ -321,17 +321,19 @@ var policies = {
if (offender.value) {
return {
error: offender.value.message || 'Unknown parsing error' + (parts[1] ? '. The entire file was ignored. As a result, the other CSS metrics and scores are miscalculated.' : ''),
file: offender.file || null,
error: offender.value.message || 'Unknown parsing error. The entire file was ignored. As a result, the other CSS metrics and scores are miscalculated.',
file: offender.url || null,
line: offender.value.position ? offender.value.position.start.line : null,
column: offender.value.position ? offender.value.position.start.column : null
};
} else {
return {
error: 'Unknown parsing error. The entire file was ignored. As a result, the other CSS metrics and scores are miscalculated.',
file: offender,
line: null,
column: null
};
}
debug('cssParsingErrors offenders transform function error with "%s"', offender);
return {
parseError: offender
};
})
};
}