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