Skip to content

Clarification on handling +∞, -∞ and Nan for numeric ranges and BigInt #74

@MundiaNderi

Description

@MundiaNderi

Hello,

I'm currently implementing the Iterator.range proposal in SpiderMonkey at Mozilla. While working on the NUMBER-RANGE implementation and extending it to support BIGINT, I encountered ambiguity in the specification when handling +∞, -∞, and NaN. The following points require clarification.

As the proposal stands, there's validation issues when handling +∞, -∞ and Nan specifically in steps:

Step 5. If start is +∞𝔽 or -∞𝔽, throw a RangeError exception. - I need to specify that typeof start is a number, otherwise throws an error that start should be finite.

Step 13. If step is NaN, throw a RangeError exception. - I need to check that step isNumberRange otherwise it throws: The 'step' argument must be a finite number.

Step 16. If step is +∞𝔽 or -∞𝔽, throw a RangeError exception. - Also needed to specify that type of step isNumberRange

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions