Re: [css-houdini-drafts] When doing CSSStyleValue.parse(), what should throw vs return null?

#1 is *definitely* a SyntaxError, no question in my mind.  I think #2 being a TypeError has strong reasoning behind it.

I don't have strong opinions on #3.  I guess `null` could be okay, but like you said in <https://github.com/w3c/css-houdini-drafts/issues/305#issuecomment-246914817>, #2 and #3 will commonly be due to the same thing (uneven support between browsers), and having them be extremely different (throw vs null) will often be a disservice, I think.

I think I'd rather have them both throw, with whatever error is most appropriate, and solve the "wrong property, or wrong value?" problem more directly.  That sounds like an API idea we can work on.  I don't think we should smuggle the use-case into which error we emit.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/305#issuecomment-291250992 using your GitHub account

Received on Monday, 3 April 2017 19:39:52 UTC