Pull in upstream fix from Prototype, patch by fredj (thanks fredj!) to fix
String.prototype.trim. (Closes #961) Note that we should also be more careful not to clobber other library prototypes. (See #962) I'm going to check this in to fix the bug for 2.5, and we'll work on the latter in 2.6. git-svn-id: http://svn.openlayers.org/trunk/openlayers@4213 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -51,18 +51,7 @@ String.prototype.contains = function(str) {
|
||||
* trailing spaces removed
|
||||
*/
|
||||
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);
|
||||
return this.replace(/^\s+/, '').replace(/\s+$/, '');
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user