pex-renderer
pex-renderer copied to clipboard
Geometry.set(falsyValue) throws an error
Trying to get ctx from null
Geometry.prototype.set = function(opts) {
const ctx = opts.ctx || this.ctx
Solution: default to opts = {}
What's the default parameters support in the browsers?
When would you call geometry.set(null) ?
Pretty good: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters#Browser_compatibility
geometry.set(null) unintentionally of course in Nodes. But could be used to clean buffers pr something maybe (thinking out loud)?