Merge pull request #4208 from gberaudo/remove_goog_string_trim

Remove goog.string.trim()
This commit is contained in:
Frédéric Junod
2015-10-05 09:06:32 +02:00
5 changed files with 7 additions and 11 deletions

View File

@@ -164,7 +164,7 @@ ol.format.IGC.prototype.readFeatureFromText = function(text, opt_options) {
} else {
m = ol.format.IGC.H_RECORD_RE_.exec(line);
if (m) {
properties[m[1]] = goog.string.trim(m[2]);
properties[m[1]] = m[2].trim();
m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line);
}
}

View File

@@ -11,7 +11,6 @@ goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('goog.math');
goog.require('goog.string');
goog.require('ol');
goog.require('ol.Feature');
goog.require('ol.FeatureStyleFunction');
@@ -392,7 +391,7 @@ ol.format.KML.readFlatCoordinates_ = function(node) {
* @return {string|undefined} Style URL.
*/
ol.format.KML.readStyleUrl_ = function(node) {
var s = goog.string.trim(ol.xml.getAllTextContent(node, false));
var s = ol.xml.getAllTextContent(node, false).trim();
if (node.baseURI) {
return goog.Uri.resolve(node.baseURI, s).toString();
} else {
@@ -410,9 +409,9 @@ ol.format.KML.readStyleUrl_ = function(node) {
ol.format.KML.readURI_ = function(node) {
var s = ol.xml.getAllTextContent(node, false);
if (node.baseURI) {
return goog.Uri.resolve(node.baseURI, goog.string.trim(s)).toString();
return goog.Uri.resolve(node.baseURI, s.trim()).toString();
} else {
return goog.string.trim(s);
return s.trim();
}
};

View File

@@ -3,7 +3,6 @@ goog.provide('ol.format.WMSCapabilities');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('goog.object');
goog.require('goog.string');
goog.require('ol');
goog.require('ol.format.XLink');
goog.require('ol.format.XML');
@@ -69,7 +68,7 @@ ol.format.WMSCapabilities.prototype.readFromNode = function(node) {
goog.asserts.assert(node.localName == 'WMS_Capabilities' ||
node.localName == 'WMT_MS_Capabilities',
'localName should be WMS_Capabilities or WMT_MS_Capabilities');
this.version = goog.string.trim(node.getAttribute('version'));
this.version = node.getAttribute('version').trim();
goog.asserts.assertString(this.version, 'this.version should be a string');
var wmsCapabilityObject = ol.xml.pushParseAndPop({
'version': this.version

View File

@@ -2,7 +2,6 @@ goog.provide('ol.format.WMTSCapabilities');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('goog.string');
goog.require('ol.extent');
goog.require('ol.format.OWS');
goog.require('ol.format.XLink');
@@ -68,7 +67,7 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Capabilities',
'localName should be Capabilities');
this.version = goog.string.trim(node.getAttribute('version'));
this.version = node.getAttribute('version').trim();
goog.asserts.assertString(this.version, 'this.version should be a string');
var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
if (!WMTSCapabilityObject) {

View File

@@ -122,8 +122,7 @@ ol.format.XSD.readNonNegativeIntegerString = function(string) {
* @return {string|undefined} String.
*/
ol.format.XSD.readString = function(node) {
var s = ol.xml.getAllTextContent(node, false);
return goog.string.trim(s);
return ol.xml.getAllTextContent(node, false).trim();
};