Catch errors when compression test fails to parse
This commit is contained in:
committed by
Richard van Velzen
parent
8287ef6781
commit
31d5825a86
@@ -159,9 +159,16 @@ function run_compress_tests() {
|
|||||||
|
|
||||||
function parse_test(file) {
|
function parse_test(file) {
|
||||||
var script = fs.readFileSync(file, "utf8");
|
var script = fs.readFileSync(file, "utf8");
|
||||||
|
// TODO try/catch can be removed after fixing https://github.com/mishoo/UglifyJS2/issues/348
|
||||||
|
try {
|
||||||
var ast = U.parse(script, {
|
var ast = U.parse(script, {
|
||||||
filename: file
|
filename: file
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Caught error while parsing tests in " + file + "\n");
|
||||||
|
console.log(e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
var tests = {};
|
var tests = {};
|
||||||
var tw = new U.TreeWalker(function(node, descend){
|
var tw = new U.TreeWalker(function(node, descend){
|
||||||
if (node instanceof U.AST_LabeledStatement
|
if (node instanceof U.AST_LabeledStatement
|
||||||
|
|||||||
Reference in New Issue
Block a user