1
0
Fork 0

Member builder recognizes private members

closure/master
Mike Gerwitz 2011-01-20 21:48:09 -05:00
parent 0ba3122db5
commit f27b0b01ab
2 changed files with 18 additions and 0 deletions

View File

@ -47,5 +47,9 @@ exports.buildProp = function( members, meta, name, value, keywords )
{ {
members[ 'protected' ][ name ] = value; members[ 'protected' ][ name ] = value;
} }
else if ( keywords[ 'private' ] )
{
members[ 'private' ][ name ] = value;
}
}; };

View File

@ -72,3 +72,17 @@ function buildPropQuick( keywords )
); );
} )(); } )();
( function testRecognizesPrivateProperty()
{
var keywords = { 'private': true },
result = buildPropQuick( keywords )
;
assert.equal(
members[ 'private' ][ name ],
value,
"Private properties are copied to the private member prototype"
);
} )();