From 021b67bbffeb9b2826beccffcd15c050a4085d00 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 22 Dec 2011 09:10:51 -0500 Subject: [PATCH] Whoops - abstract member param names may now contain underscores --- doc/classes.texi | 2 +- lib/util.js | 4 ++-- test/test-util-prop-parse.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/classes.texi b/doc/classes.texi index ba8ef4c..e5bfe15 100644 --- a/doc/classes.texi +++ b/doc/classes.texi @@ -1309,7 +1309,7 @@ The subtype must implement at least the number of parameters declared in @itemize @item Each name in @var{params} must be a valid variable name, as satisfied by the - regular expression @code{/^[a-z][a-z0-9]*$/i}. + regular expression @code{/^[a-z_][a-z0-9_]*$/i}. @item The names are use purely for documentation and are not semantic. @end itemize diff --git a/lib/util.js b/lib/util.js index 5b6e5fb..7cb42d0 100644 --- a/lib/util.js +++ b/lib/util.js @@ -366,10 +366,10 @@ function verifyAbstractNames( name, params ) var i = params.length; while ( i-- ) { - if ( params[ i ].match( /^[a-z][a-z0-9]*$/i ) === null ) + if ( params[ i ].match( /^[a-z_][a-z0-9_]*$/i ) === null ) { throw SyntaxError( - "Member " + name + " contains invalid parameter: '" + + "Member " + name + " contains invalid parameter '" + params[ i ] + "'" ); } diff --git a/test/test-util-prop-parse.js b/test/test-util-prop-parse.js index 73009d2..2a9e975 100644 --- a/test/test-util-prop-parse.js +++ b/test/test-util-prop-parse.js @@ -205,7 +205,7 @@ assert.equal( assert.doesNotThrow( function() { - util.propParse( { 'abstract foo': [ 'valid' ] }, {} ); + util.propParse( { 'abstract foo': [ 'valid_name' ] }, {} ); }, SyntaxError, 'Valid var names as args should not throw exceptions' ); } )();