1
0
Fork 0

[#25] Moved single access modifier getter/setter test to VisibilityTest

closure/master
Mike Gerwitz 2011-10-27 20:44:25 -04:00
parent f19a62e733
commit 05df0b485c
2 changed files with 33 additions and 3 deletions

View File

@ -210,7 +210,7 @@ exports.buildGetter = function( members, meta, name, value, keywords, base )
validateGetterSetter( members, keywords, name, base ); validateGetterSetter( members, keywords, name, base );
Object.defineProperty( Object.defineProperty(
getMemberVisibility( members, keywords ), getMemberVisibility( members, keywords, name ),
name, name,
{ {
get: value, get: value,
@ -246,7 +246,7 @@ exports.buildSetter = function( members, meta, name, value, keywords, base )
validateGetterSetter( members, keywords, name, base ); validateGetterSetter( members, keywords, name, base );
Object.defineProperty( Object.defineProperty(
getMemberVisibility( members, keywords ), getMemberVisibility( members, keywords, name ),
name, name,
{ {
set: value, set: value,

View File

@ -195,7 +195,7 @@ require( 'common' ).testCase(
_self.assertOk( _self.assertOk(
( e.message.search( name ) > -1 ), ( e.message.search( name ) > -1 ),
'Multiple access modifier error message should ' + 'Multiple access modifier error message should ' +
'contain name of member' 'contain name of member; received: ' + e.message
); );
return; return;
@ -376,4 +376,34 @@ require( 'common' ).testCase(
); );
} ); } );
}, },
'Only one access modifier may be used per getter': function()
{
if ( !gst ) return;
var _self = this;
this.multiVisFailureTest( function( name, keywords )
{
_self.sut.buildGetter(
_self.members, {}, name, function() {}, keywords, {}
);
} );
},
'Only one access modifier may be used per setter': function()
{
if ( !gst ) return;
var _self = this;
this.multiVisFailureTest( function( name, keywords )
{
_self.sut.buildSetter(
_self.members, {}, name, function() {}, keywords, {}
);
} );
},
} ); } );