code like:

`if (defined(WebGLRenderingContext)) {` 

will still crash if WebGLRenderingContext doesn't exist.  I'm OK with sticking with the global and switching this to `typeof WebGLRenderingContext === 'undefined'` if that works for you.