add a new Class test, to test the inheritance chain, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@12214 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -163,6 +163,24 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_inheritance_chain(t) {
|
||||||
|
t.plan(1);
|
||||||
|
var A = new OpenLayers.Class({
|
||||||
|
initialize: function() {
|
||||||
|
this.a = 'foo';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var B = new OpenLayers.Class(A, {});
|
||||||
|
var C = new OpenLayers.Class(B, {
|
||||||
|
initialize: function() {
|
||||||
|
B.prototype.initialize.apply(this, arguments);
|
||||||
|
this.a = this.a + 'bar';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var c = new C;
|
||||||
|
t.eq(c.a, 'foobar', 'constructor at the root is called');
|
||||||
|
}
|
||||||
|
|
||||||
// Remove this at 3.0
|
// Remove this at 3.0
|
||||||
function test_Class_backwards(t) {
|
function test_Class_backwards(t) {
|
||||||
t.plan(4);
|
t.plan(4);
|
||||||
|
|||||||
Reference in New Issue
Block a user