Skip to content

numberList() with non-finite or fractional bounds throws raw RangeError #37804

Description

@soroush5

Summary

numberList() with non-finite or fractional bounds throws a raw RangeError: Invalid array length instead of an ExpressionExtensionError. Inside an expression the raw error is swallowed and the expression silently evaluates to undefined/null — wrong data with no error trigger.

Real runs (extendedFunctions.numberList):

  • numberList(1, 5) → length 5
  • numberList(NaN, 5)RangeError: Invalid array length
  • numberList(Infinity, 5)RangeError: Invalid array length
  • numberList(1.5, 5.7)RangeError: Invalid array length (size 5.2 is not a valid array length)

Root cause

size = Math.abs(start - end) + 1 flows unvalidated into new Array(size). Sibling validators in the same expression family raise ExpressionExtensionError for bad input; this one lets the engine error escape.

Expected

Non-finite or non-integer bounds raise a clear ExpressionExtensionError like every other input validation in the expression extensions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:in-linearIssue or PR is now in Linearstatus:team-assignedA team has been assigned the issue or PRteam:catsIssue is with the Cats team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions