Remove goog.isDef from attribution.js through color.js (-54 B)

This commit is contained in:
Tim Schaub
2015-09-18 14:51:24 +09:00
parent 37d0176642
commit c8e9525f3b
4 changed files with 6 additions and 7 deletions

View File

@@ -38,8 +38,7 @@ ol.Attribution = function(options) {
* @private
* @type {Object.<string, Array.<ol.TileRange>>}
*/
this.tileRanges_ = goog.isDef(options.tileRanges) ?
options.tileRanges : null;
this.tileRanges_ = options.tileRanges ? options.tileRanges : null;
};

View File

@@ -21,7 +21,7 @@ ol.CenterConstraint.createExtent = function(extent) {
* @return {ol.Coordinate|undefined} Center.
*/
function(center) {
if (goog.isDef(center)) {
if (center) {
return [
goog.math.clamp(center[0], extent[0], extent[2]),
goog.math.clamp(center[1], extent[1], extent[3])

View File

@@ -91,7 +91,7 @@ ol.Collection = function(opt_array) {
* @private
* @type {!Array.<T>}
*/
this.array_ = goog.isDef(opt_array) ? opt_array : [];
this.array_ = opt_array ? opt_array : [];
this.updateLength_();

View File

@@ -62,7 +62,7 @@ ol.color.rgbaColorRe_ =
ol.color.blend = function(dst, src, opt_color) {
// http://en.wikipedia.org/wiki/Alpha_compositing
// FIXME do we need to scale by 255?
var out = goog.isDef(opt_color) ? opt_color : [];
var out = opt_color ? opt_color : [];
var dstA = dst[3];
var srcA = src[3];
if (dstA == 1) {
@@ -271,7 +271,7 @@ ol.color.isValid = function(color) {
* @return {ol.Color} Clamped color.
*/
ol.color.normalize = function(color, opt_color) {
var result = goog.isDef(opt_color) ? opt_color : [];
var result = opt_color ? opt_color : [];
result[0] = goog.math.clamp((color[0] + 0.5) | 0, 0, 255);
result[1] = goog.math.clamp((color[1] + 0.5) | 0, 0, 255);
result[2] = goog.math.clamp((color[2] + 0.5) | 0, 0, 255);
@@ -309,7 +309,7 @@ ol.color.toString = function(color) {
* @return {ol.Color} Transformed color.
*/
ol.color.transform = function(color, transform, opt_color) {
var result = goog.isDef(opt_color) ? opt_color : [];
var result = opt_color ? opt_color : [];
result = goog.vec.Mat4.multVec3(transform, color, result);
goog.asserts.assert(goog.isArray(result), 'result should be an array');
result[3] = color[3];