Removed visibility dependency from test-class-abstract
parent
40228361a1
commit
d74c01b562
|
@ -30,20 +30,21 @@ var common = require( './common' ),
|
||||||
// not abstract
|
// not abstract
|
||||||
var Foo = Class.extend( {} );
|
var Foo = Class.extend( {} );
|
||||||
|
|
||||||
// abstract
|
// abstract (ctor_called is not a class member to ensure that visibility bugs do
|
||||||
var AbstractFoo = Class.extend(
|
// not impact our test)
|
||||||
{
|
var ctor_called = false,
|
||||||
ctorCalled: false,
|
AbstractFoo = Class.extend(
|
||||||
|
|
||||||
__construct: function()
|
|
||||||
{
|
{
|
||||||
this.ctorCalled = true;
|
__construct: function()
|
||||||
},
|
{
|
||||||
|
ctor_called = true;
|
||||||
|
},
|
||||||
|
|
||||||
'abstract method': [ 'one', 'two', 'three' ],
|
'abstract method': [ 'one', 'two', 'three' ],
|
||||||
|
|
||||||
'abstract second': [],
|
'abstract second': [],
|
||||||
});
|
})
|
||||||
|
;
|
||||||
|
|
||||||
// still abstract (didn't provide a concrete implementation of both abstract
|
// still abstract (didn't provide a concrete implementation of both abstract
|
||||||
// methods)
|
// methods)
|
||||||
|
@ -109,8 +110,10 @@ assert.ok(
|
||||||
"Concrete subclasses can be instantiated"
|
"Concrete subclasses can be instantiated"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ctor_called = false;
|
||||||
|
new ConcreteFoo();
|
||||||
assert.equal(
|
assert.equal(
|
||||||
( new ConcreteFoo() ).ctorCalled,
|
ctor_called,
|
||||||
true,
|
true,
|
||||||
"Can call constructors of abstract supertypes"
|
"Can call constructors of abstract supertypes"
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue