From ab87eb8af09d12a09850a670f537496d7996a16d Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 29 Sep 2015 09:51:41 -0600 Subject: [PATCH] Remove remaining goog.isDefAndNotNull() calls --- src/ol/source/tilewmssource.js | 4 ++-- src/ol/source/wmtssource.js | 2 +- src/ol/view.js | 6 ++---- src/ol/xml.js | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ol/source/tilewmssource.js b/src/ol/source/tilewmssource.js index c54ab82dd1..5f015cd07d 100644 --- a/src/ol/source/tilewmssource.js +++ b/src/ol/source/tilewmssource.js @@ -60,7 +60,7 @@ ol.source.TileWMS = function(opt_options) { * @private * @type {!Array.} */ - this.urls_ = goog.isDefAndNotNull(urls) ? urls : []; + this.urls_ = urls || []; /** * @private @@ -348,7 +348,7 @@ ol.source.TileWMS.prototype.setUrl = function(url) { * @api stable */ ol.source.TileWMS.prototype.setUrls = function(urls) { - this.urls_ = goog.isDefAndNotNull(urls) ? urls : []; + this.urls_ = urls || []; this.resetCoordKeyPrefix_(); this.changed(); }; diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 586eb8038e..4bb1dfdeb0 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -92,7 +92,7 @@ ol.source.WMTS = function(options) { * @private * @type {!Array.} */ - this.urls_ = goog.isDefAndNotNull(urls) ? urls : []; + this.urls_ = urls || []; // FIXME: should we guess this requestEncoding from options.url(s) // structure? that would mean KVP only if a template is not provided. diff --git a/src/ol/view.js b/src/ol/view.js index e06c0e670c..2e3f161575 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -275,8 +275,7 @@ ol.View.prototype.getHints = function() { */ ol.View.prototype.calculateExtent = function(size) { var center = this.getCenter(); - goog.asserts.assert(goog.isDefAndNotNull(center), - 'The view center is not defined'); + goog.asserts.assert(center, 'The view center is not defined'); var resolution = this.getResolution(); goog.asserts.assert(resolution !== undefined, 'The view resolution is not defined'); @@ -552,8 +551,7 @@ ol.View.prototype.centerOn = function(coordinate, size, position) { * @return {boolean} Is defined. */ ol.View.prototype.isDef = function() { - return goog.isDefAndNotNull(this.getCenter()) && - this.getResolution() !== undefined; + return !!this.getCenter() && this.getResolution() !== undefined; }; diff --git a/src/ol/xml.js b/src/ol/xml.js index b45fdbe183..000e7382b2 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -136,7 +136,7 @@ ol.xml.getLocalNameIE_ = function(node) { return localName; } var baseName = node.baseName; - goog.asserts.assert(goog.isDefAndNotNull(baseName), + goog.asserts.assert(baseName, 'Failed to get localName/baseName of node %s', node); return baseName; };