You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's no reason that isCSSColorString should ever fail; it should return true or false.
For example:
> phet.scenery.Color.isCSSColorString( null )
Color.js:812 Uncaught TypeError: Cannot read property 'replace' of null
at Function.preprocessCSS (Color.js:812)
at Function.isCSSColorString (Color.js:831)
at eval (eval at window.assertions.assertFunction (assert.js:25), <anonymous>:1:20)
at window.assertions.assertFunction (assert.js:25)
at Color.set (Color.js:90)
at new Color (Color.js:47)
at Function.toColor (Color.js:623)
at <anonymous>:1:20
The text was updated successfully, but these errors were encountered:
On Slack, @jonathanolson says that isCSSColorString is documented to only support string. If that's the case, please add an assertion. EDIT: That also seems like an unnessary restriction to me.
Added an assertion. Presumably we could have a place checking to see if something is a valid color value if needed (and a type check included there), I'd prefer not to add type-checks in this type of function.
Color
isCSSColorString
was added in 4e26f60 for #1115.This is affecting work in bamboo, and I'll need to work around it.
It's buggy, and these examples are failing:
Color.isCSSColorString( null )
Color.isCSSColorString( undefined )
Color.isCSSColorString( {} )
There's no reason that
isCSSColorString
should ever fail; it should return true or false.For example:
The text was updated successfully, but these errors were encountered: