Whoops - abstract member param names may now contain underscores
parent
ac837107c5
commit
021b67bbff
|
@ -1309,7 +1309,7 @@ The subtype must implement at least the number of parameters declared in
|
||||||
@itemize
|
@itemize
|
||||||
@item
|
@item
|
||||||
Each name in @var{params} must be a valid variable name, as satisfied by the
|
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
|
@item
|
||||||
The names are use purely for documentation and are not semantic.
|
The names are use purely for documentation and are not semantic.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
|
@ -366,10 +366,10 @@ function verifyAbstractNames( name, params )
|
||||||
var i = params.length;
|
var i = params.length;
|
||||||
while ( i-- )
|
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(
|
throw SyntaxError(
|
||||||
"Member " + name + " contains invalid parameter: '" +
|
"Member " + name + " contains invalid parameter '" +
|
||||||
params[ i ] + "'"
|
params[ i ] + "'"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,7 @@ assert.equal(
|
||||||
|
|
||||||
assert.doesNotThrow( function()
|
assert.doesNotThrow( function()
|
||||||
{
|
{
|
||||||
util.propParse( { 'abstract foo': [ 'valid' ] }, {} );
|
util.propParse( { 'abstract foo': [ 'valid_name' ] }, {} );
|
||||||
}, SyntaxError, 'Valid var names as args should not throw exceptions' );
|
}, SyntaxError, 'Valid var names as args should not throw exceptions' );
|
||||||
} )();
|
} )();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue