Improve type checking in WebGL support test

This commit is contained in:
Tom Payne
2013-12-04 11:59:29 +01:00
parent d6dc1a2c6f
commit 0d3583bd8d
+6 -2
View File
@@ -52,7 +52,11 @@ ol.webgl.getContext = function(canvas, opt_attributes) {
* @const * @const
* @type {boolean} * @type {boolean}
*/ */
ol.webgl.SUPPORTED = (function() { ol.webgl.SUPPORTED = (
/**
* @return {boolean} WebGL supported.
*/
function() {
if (!('WebGLRenderingContext' in goog.global)) { if (!('WebGLRenderingContext' in goog.global)) {
return false; return false;
} }
@@ -65,4 +69,4 @@ ol.webgl.SUPPORTED = (function() {
} catch (e) { } catch (e) {
return false; return false;
} }
})(); })();