Merge pull request #7914 from gberaudo/some_easy_window_cleanups

Some easy window cleanups
This commit is contained in:
Tim Schaub
2018-03-03 13:04:30 -07:00
committed by GitHub
3 changed files with 6 additions and 6 deletions

View File

@@ -41,7 +41,7 @@ let WEBGL_EXTENSIONS; // value is set below
let HAS_WEBGL = false;
if ('WebGLRenderingContext' in window) {
if (typeof window !== 'undefined' && 'WebGLRenderingContext' in window) {
try {
const canvas = /** @type {HTMLCanvasElement} */ (document.createElement('CANVAS'));
const gl = getContext(canvas, {failIfMajorPerformanceCaveat: true});