[OpenLayers-Trac] [OpenLayers] #3454: OpenLayers.Class - use
P.prototype.initialize instead of P in the constructor
OpenLayers
trac-20090302 at openlayers.org
Mon Aug 8 01:30:52 EDT 2011
#3454: OpenLayers.Class - use P.prototype.initialize instead of P in the
constructor
-----------------------------+----------------------------------------------
Reporter: erilem | Owner: tschaub
Type: feature | Status: new
Priority: major | Milestone: 2.11 Release
Component: BaseTypes.Class | Version: 2.10
Keywords: | State:
-----------------------------+----------------------------------------------
This is to accommodate this test case:
{{{
var A = OpenLayers.Class({
initialize: function() {
this.a = "foo";
}
});
var B = OpenLayers.Class(A, {});
// overwrite
var proto = A.prototype;
A = function() {
this.a = "bar";
};
A.prototype = proto;
A.prototype.initialize = A;
var _A = A;
t.eq(b.a, "bar", "ctor overwritten");
}}}
See http://osgeo-org.1803224.n2.nabble.com/2-10-and-2-11-RC1-OpenLayers-
Class-behavior-changes-td6615312.html for the whole discussion.
--
Ticket URL: <http://trac.openlayers.org/ticket/3454>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list