On Sun, Jul 24, 2011 at 11:38 PM, Andreas Hocevar <[email protected]> wrote:
> Hi Didier,
>
> not sure if you've seen my follow-up mail. You need to re-assign the protoype
> after the snippet I posted. So the whole snippet would be:
>
> var X= OpenLayers.Class({
> initialize:function() { this._p= "A.initialize";
> OpenLayers.Console.info(this._p); },
> pa:"PA",
> p_:null,
> ma:function() { OpenLayers.Console.info("A.ma="+this.pa); }
> });
> xProto = X.prototype;
> xProto.initialize = function() { this.p_= "A.initialize-new";
> OpenLayers.Console.info(this.p_); }
> X = xProto.initialize;
> X.proto = xProto;
Is setting xProto.initialize mandatory? How about this little simplification:
var proto = X.prototype;
X = function() { /* new ctor */ };
X.prototype = proto;
?
I guess the same simplification should apply to Andreas' OverloadB snippet.
Cheers,
PS: BTW, I agree there's no regression here :-)
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev