Inline simple goog.isDef() calls

This commit is contained in:
Tim Schaub
2015-09-27 10:34:44 -06:00
parent a86c270f6a
commit e3951fa3c6
45 changed files with 172 additions and 170 deletions

View File

@@ -836,7 +836,7 @@ describe('ol.extent', function() {
it('takes arbitrary function', function() {
var transformFn = function(input, output, opt_dimension) {
var dimension = goog.isDef(opt_dimension) ? opt_dimension : 2;
var dimension = opt_dimension !== undefined ? opt_dimension : 2;
if (output === undefined) {
output = new Array(input.length);
}

View File

@@ -48,7 +48,7 @@ describe('ol.interaction.Draw', function() {
var viewport = map.getViewport();
// calculated in case body has top < 0 (test runner with small window)
var position = goog.style.getClientPosition(viewport);
var shiftKey = goog.isDef(opt_shiftKey) ? opt_shiftKey : false;
var shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false;
var event = new ol.MapBrowserPointerEvent(type, map,
new ol.pointer.PointerEvent(type,
new goog.events.BrowserEvent({

View File

@@ -64,7 +64,7 @@ describe('ol.interaction.Modify', function() {
var viewport = map.getViewport();
// calculated in case body has top < 0 (test runner with small window)
var position = goog.style.getClientPosition(viewport);
var shiftKey = goog.isDef(opt_shiftKey) ? opt_shiftKey : false;
var shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false;
var event = new ol.MapBrowserPointerEvent(type, map,
new ol.pointer.PointerEvent(type,
new goog.events.BrowserEvent({

View File

@@ -79,7 +79,7 @@ describe('ol.interaction.Select', function() {
var viewport = map.getViewport();
// calculated in case body has top < 0 (test runner with small window)
var position = goog.style.getClientPosition(viewport);
var shiftKey = goog.isDef(opt_shiftKey) ? opt_shiftKey : false;
var shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false;
var event = new ol.MapBrowserPointerEvent(type, map,
new ol.pointer.PointerEvent(type,
new goog.events.BrowserEvent({

View File

@@ -54,7 +54,7 @@ describe('ol.interaction.Translate', function() {
var viewport = map.getViewport();
// calculated in case body has top < 0 (test runner with small window)
var position = goog.style.getClientPosition(viewport);
var shiftKey = goog.isDef(opt_shiftKey) ? opt_shiftKey : false;
var shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false;
var event = new ol.MapBrowserPointerEvent(type, map,
new ol.pointer.PointerEvent(type,
new goog.events.BrowserEvent({

View File

@@ -118,7 +118,7 @@ describe('ol.pointer.TouchSource', function() {
});
function simulateTouchEvent(type, changedTouches, touches) {
touches = goog.isDef(touches) ? touches : changedTouches;
touches = touches !== undefined ? touches : changedTouches;
var event = new goog.events.BrowserEvent({
type: type,