1
0
Fork 0

Whoops - abstract member param names may now contain underscores

perfodd
Mike Gerwitz 2011-12-22 09:10:51 -05:00
parent ac837107c5
commit 021b67bbff
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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 ] + "'"
);
}

View File

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