Skip to content

[css-typed-om] is this intentionally thing to throw different errors when failed converting to unit type from string? #432

Closed
@hwanseung

Description

@hwanseung

when failed converting to unit type from string in CSSUnitValue's constructor, it throws a SyntexError.
but when setting |unit| value, it thorws a TypeError.
is this intentionally thing to throw different errors?

i think if it were not intentionally, it is better to throw a same error about upper two cases in order to maintain consistency.
and if these have to throw a same error, i think it is better to throw SyntaxError than TypeError.

https://drafts.css-houdini.org/css-typed-om-1/#cssunitvalue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions