r104864 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104863‎ | r104864 | r104865 >
Date:15:45, 1 December 2011
Author:hashar
Status:deferred
Tags:
Comment:
warn on invalid regex passed to --filter
Modified paths:
  • /trunk/extensions/VisualEditor/tests/parser/parserTests.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js
@@ -81,7 +81,13 @@
8282 }
8383 var test_filter = null;
8484 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+ }
8692 console.log( "Filtering title test using Regexp " + test_filter );
8793 }
8894 if( !argv.color ) {

Status & tagging log