Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js |
— | — | @@ -81,7 +81,13 @@ |
82 | 82 | } |
83 | 83 | var test_filter = null; |
84 | 84 | if( argv.filter ) { // null is the default by definition |
85 | | - test_filter = new RegExp( argv.filter ); |
| 85 | + try { |
| 86 | + test_filter = new RegExp( argv.filter ); |
| 87 | + } catch(e) { |
| 88 | + console.error( "\nERROR> --filter was given an invalid regular expression."); |
| 89 | + console.error( "ERROR> See below for JS engine error:\n" + e + "\n" ); |
| 90 | + process.exit( 1 ); |
| 91 | + } |
86 | 92 | console.log( "Filtering title test using Regexp " + test_filter ); |
87 | 93 | } |
88 | 94 | if( !argv.color ) { |