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
According to the spec, as long as the given string can be parsed into a <dimension-token>, the return value is the reification of the token. And reification doesn't have type checking, either.
So CSSNumericValue.parse('1xyz') should return something non-null, which doesn't make sense, and is inconsistent with the CSSUnitValue(value, type) constructor, which throws when the type is invalid.
I think we should throw a SyntaxError when the unit is invalid. I'll put up a PR to fix it.
The text was updated successfully, but these errors were encountered:
xiaochengh
added a commit
to xiaochengh/css-houdini-drafts
that referenced
this issue
Jan 27, 2022
According to the spec, as long as the given string can be parsed into a
<dimension-token>
, the return value is the reification of the token. And reification doesn't have type checking, either.So
CSSNumericValue.parse('1xyz')
should return something non-null, which doesn't make sense, and is inconsistent with the CSSUnitValue(value, type) constructor, which throws when the type is invalid.I think we should throw a
SyntaxError
when the unit is invalid. I'll put up a PR to fix it.The text was updated successfully, but these errors were encountered: