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' ); } )();