Remove goog.global (#5178)
* Remove goog.global
* Correct externs location
* Use Function('return this')
* Remove global externs
This commit is contained in:
committed by
Andreas Hocevar
parent
6efd3dab0b
commit
cd6494149b
@@ -34,7 +34,7 @@ ol.has.MAC = ua.indexOf('macintosh') !== -1;
|
||||
* @type {number}
|
||||
* @api stable
|
||||
*/
|
||||
ol.has.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1;
|
||||
ol.has.DEVICE_PIXEL_RATIO = ol.global.devicePixelRatio || 1;
|
||||
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,7 @@ ol.has.CANVAS = ol.ENABLE_CANVAS && (
|
||||
* @return {boolean} Canvas supported.
|
||||
*/
|
||||
function() {
|
||||
if (!('HTMLCanvasElement' in goog.global)) {
|
||||
if (!('HTMLCanvasElement' in ol.global)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
@@ -81,7 +81,7 @@ ol.has.CANVAS = ol.ENABLE_CANVAS && (
|
||||
* @type {boolean}
|
||||
* @api stable
|
||||
*/
|
||||
ol.has.DEVICE_ORIENTATION = 'DeviceOrientationEvent' in goog.global;
|
||||
ol.has.DEVICE_ORIENTATION = 'DeviceOrientationEvent' in ol.global;
|
||||
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ ol.has.DOM = ol.ENABLE_DOM;
|
||||
* @type {boolean}
|
||||
* @api stable
|
||||
*/
|
||||
ol.has.GEOLOCATION = 'geolocation' in goog.global.navigator;
|
||||
ol.has.GEOLOCATION = 'geolocation' in ol.global.navigator;
|
||||
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ ol.has.GEOLOCATION = 'geolocation' in goog.global.navigator;
|
||||
* @type {boolean}
|
||||
* @api stable
|
||||
*/
|
||||
ol.has.TOUCH = ol.ASSUME_TOUCH || 'ontouchstart' in goog.global;
|
||||
ol.has.TOUCH = ol.ASSUME_TOUCH || 'ontouchstart' in ol.global;
|
||||
|
||||
|
||||
/**
|
||||
@@ -115,7 +115,7 @@ ol.has.TOUCH = ol.ASSUME_TOUCH || 'ontouchstart' in goog.global;
|
||||
* @const
|
||||
* @type {boolean}
|
||||
*/
|
||||
ol.has.POINTER = 'PointerEvent' in goog.global;
|
||||
ol.has.POINTER = 'PointerEvent' in ol.global;
|
||||
|
||||
|
||||
/**
|
||||
@@ -123,7 +123,7 @@ ol.has.POINTER = 'PointerEvent' in goog.global;
|
||||
* @const
|
||||
* @type {boolean}
|
||||
*/
|
||||
ol.has.MSPOINTER = !!(goog.global.navigator.msPointerEnabled);
|
||||
ol.has.MSPOINTER = !!(ol.global.navigator.msPointerEnabled);
|
||||
|
||||
|
||||
/**
|
||||
@@ -142,7 +142,7 @@ ol.has.WEBGL;
|
||||
var textureSize;
|
||||
var /** @type {Array.<string>} */ extensions = [];
|
||||
|
||||
if ('WebGLRenderingContext' in goog.global) {
|
||||
if ('WebGLRenderingContext' in ol.global) {
|
||||
try {
|
||||
var canvas = /** @type {HTMLCanvasElement} */
|
||||
(document.createElement('CANVAS'));
|
||||
|
||||
Reference in New Issue
Block a user