Extended existing visibility tests to include methods
parent
38c16048cb
commit
02d0c07f98
|
@ -30,11 +30,19 @@ var common = require( './common' ),
|
|||
prot = 'bar',
|
||||
priv = 'baz',
|
||||
|
||||
pubf = function() {},
|
||||
protf = function() {},
|
||||
privf = function() {},
|
||||
|
||||
// new anonymous class instance
|
||||
foo = Class.extend( {
|
||||
'public pub': pub,
|
||||
'protected peeps': prot,
|
||||
'private parts': priv,
|
||||
|
||||
'public pubf': pubf,
|
||||
'protected protf': protf,
|
||||
'private privf': privf,
|
||||
})();
|
||||
|
||||
|
||||
|
@ -45,6 +53,12 @@ var common = require( './common' ),
|
|||
pub,
|
||||
"Public properties are accessible via public interface"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
foo.pubf,
|
||||
pubf,
|
||||
"Public methods are accessible via public interface"
|
||||
);
|
||||
} )();
|
||||
|
||||
|
||||
|
@ -61,5 +75,17 @@ var common = require( './common' ),
|
|||
undefined,
|
||||
"Private properties are inaccessible via public interface"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
foo.protf,
|
||||
undefined,
|
||||
"Protected methods are inaccessible via public interface"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
foo.privf,
|
||||
undefined,
|
||||
"Private methods are inaccessible via public interface"
|
||||
);
|
||||
} )();
|
||||
|
||||
|
|
Loading…
Reference in New Issue