sinisterchipmunk / jax

Framework for creating rich WebGL-enabled applications using JavaScript and Ruby
http://jaxgl.com
MIT License
96 stars 16 forks source link

Jax.Context should throw error if canvas can't be found #68

Closed sinisterchipmunk closed 12 years ago

sinisterchipmunk commented 12 years ago

If a canvas ID is given but can't be resolved (e.g. the <canvas> element hasn't finished loading yet, which is a common JS development mistake), Jax.Context should throw an error instead of failing silently.

important: Jax.Context is currently designed so that it can be initialized without a corresponding <canvas> element. There are use cases for this and it is valid usage of Jax.Context, but if a not-undefined argument is given to represent the canvas and it can't be resolved, then an error should be raised in order to prevent debugging nightmares.