Comparing version 3.0.7 to 3.0.8
@@ -8,2 +8,3 @@ /** @module gl-util/context */ | ||
if (!o) o = {} | ||
else if (typeof o === 'string') o = {container: o} | ||
@@ -44,3 +45,3 @@ // HTMLCanvasElement | ||
var c = document.querySelector(o.container) | ||
if (!o.container) throw Error('Element ' + o.container + ' is not found') | ||
if (!c) throw Error('Element ' + o.container + ' is not found') | ||
o.container = c | ||
@@ -47,0 +48,0 @@ } |
{ | ||
"name": "gl-util", | ||
"version": "3.0.7", | ||
"version": "3.0.8", | ||
"description": "Set of practical webgl utils", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,1 +13,11 @@ 'use strict' | ||
}) | ||
t('context container as string', t => { | ||
let canvas = document.body.appendChild(document.createElement('canvas')) | ||
canvas.id = 'canvas' | ||
let gl = context('#canvas') | ||
document.body.removeChild(canvas) | ||
t.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30639
743