8000 Throw RangeError instead of TypeError for format with non-object types · Issue #128 · tc39/proposal-intl-duration-format · GitHub
[go: up one dir, main page]

Skip to content

Throw RangeError instead of TypeError for format with non-object types #128

@Constellation

Description

@Constellation

We will integrate Temporal duration related changes in the future, and it will change the current format function's TypeError to RangeError.
So, how about making it RangeError from the beginning? I think the rationale is that, "Intl.Duration#format can format Duration described as a String in a particular syntax, but in this spec, no syntax is accepted, so it is always throwing a RangeError".

var fmt = new Intl.DurationFormat('en');
fmt.format("");  // TypeError. But if Temporal is integrated, it will become RangeError

Metadata

Metadata

Assignees

No one assigned

    Labels

    consensusWe reached a consensus in a discussion meeting, through email or the issue discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0