From 31d5825a86a6bcee91187b4a3962e0cd0f3b0d93 Mon Sep 17 00:00:00 2001 From: Anthony Van de Gejuchte Date: Wed, 8 Jun 2016 20:11:32 +0200 Subject: [PATCH] Catch errors when compression test fails to parse --- test/run-tests.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/run-tests.js b/test/run-tests.js index 0a249b9f..6614b2a5 100755 --- a/test/run-tests.js +++ b/test/run-tests.js @@ -159,9 +159,16 @@ function run_compress_tests() { function parse_test(file) { var script = fs.readFileSync(file, "utf8"); - var ast = U.parse(script, { - filename: file - }); + // TODO try/catch can be removed after fixing https://github.com/mishoo/UglifyJS2/issues/348 + try { + var ast = U.parse(script, { + filename: file + }); + } catch (e) { + console.log("Caught error while parsing tests in " + file + "\n"); + console.log(e); + throw e; + } var tests = {}; var tw = new U.TreeWalker(function(node, descend){ if (node instanceof U.AST_LabeledStatement -- 2.34.1