[#25] Moved single access modifier getter/setter test to VisibilityTest
parent
f19a62e733
commit
05df0b485c
|
@ -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,
|
||||||
|
|
|
@ -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, {}
|
||||||
|
);
|
||||||
|
} );
|
||||||
|
},
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in New Issue