[OpenLayers-Dev] OL 2.4 conflict with MS Ajax.Net

Frédéric Junod frederic.junod at camptocamp.com
Tue Sep 11 03:02:02 EDT 2007


John, 

I have opened a ticket for that, see:
http://trac.openlayers.org/ticket/961

fredj

Le Mon, 10 Sep 2007 10:40:57 -0500,
John Cole <john.cole at uai.com> a écrit :

> I’ve run into an issue with OL 2.4 (branch HEAD) and Microsoft Ajax.Net.

> In BaseTypes.js, the following function:

> String.prototype.trim = function() {
>     var b = 0;
>     while(this.substr(b,1) == " ") {
>         b++;
>     }
>     var e = this.length - 1;
>     while(this.substr(e,1) == " ") {
>         e--;
>     }
>     return this.substring(b, e+1);
> 
> };
> 
> Is failing because e is going negative and goes into an endless loop.  The
> string being fed (from an Ajax.Net call) is simply two spaces (“  “).
> 
> It appears that Ajax.Net is also prototyping a trim function onto String,
> and commenting out the one in BaseTypes.js gets everything working again.
> How do you detect that a function has already been prototyped on to a class
> so OL doesn’t have to do it?
> 
>  
> Thanks,
> 
> John

-- 
Frédéric Junod
Camptocamp SA



More information about the Dev mailing list