pdf.js/test/reporter.js

29 lines
608 B
JavaScript
Raw Normal View History

2013-02-01 08:29:37 +09:00
"use strict";
module.exports = {
reporter: function (res) {
var len = 0;
var str = "";
res.forEach(function (r) {
var file = r.file;
var err = r.error;
switch(err.code) {
case 'W004': // variable is already defined
case 'W018': // confusing use of !
break;
default:
len++;
str += file + ": line " + err.line + ", col " +
err.character + ", " + err.reason + "\n";
}
});
if (str) {
process.stdout.write(str + "\n" + len + " error" +
((len === 1) ? "" : "s") + "\n");
}
}
};