aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Van de Gejuchte <anthonyvdgent@gmail.com>2016-06-08 20:11:32 +0200
committerRichard van Velzen <rvanvelzen@experty.com>2016-06-09 21:12:15 +0200
commit31d5825a86a6bcee91187b4a3962e0cd0f3b0d93 (patch)
tree20e02288bf2b13fbeba531835c2591eecf431422
parent8287ef67810f2332459fa157b26e556f55b36b98 (diff)
downloadtracifyjs-31d5825a86a6bcee91187b4a3962e0cd0f3b0d93.tar.gz
tracifyjs-31d5825a86a6bcee91187b4a3962e0cd0f3b0d93.zip
Catch errors when compression test fails to parse
-rwxr-xr-xtest/run-tests.js13
1 files 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