1
0
Fork 0

Added test case for visibility escalation internally

For completeness, since this is how I originally observed the issue fixed in
the previous commit.
perfodd
Mike Gerwitz 2014-02-04 23:49:25 -05:00
parent bcada87240
commit 513bd1a733
1 changed files with 37 additions and 0 deletions

View File

@ -711,6 +711,43 @@ require( 'common' ).testCase(
}, },
/**
* Similar to above test, but ensure that overrides also take effect via
* the internal visibility object.
*/
'Protected method overrides are observable by supertype': function()
{
var _self = this,
called = false;
var C = this.Class(
{
'public doFoo': function()
{
// will be overridden
return this.foo();
},
// will be overridden
'virtual protected foo': function()
{
_self.fail( true, false, "Method not overridden" );
},
} )
.extend(
{
// should be invoked by doFoo; visibiility escalation
'public override foo': function()
{
called = true;
},
} );
C().doFoo();
this.assertOk( called );
},
/** /**
* There was an issue where the private property object was not proxying * There was an issue where the private property object was not proxying
* values to the true protected values. This would mean that when the parent * values to the true protected values. This would mean that when the parent