Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: don't coerce non-string primitives to strings, esp. time zones, offsets, and calendars #2574

Merged
merged 2 commits into from
Jul 18, 2023

Commits on Jul 17, 2023

  1. Don't coerce non-String inputs to strings

    This commit stops converting non-string inputs to strings when
    parsing ISO strings or property bag fields.
    
    When numbers are coerced to strings, the result is sometimes a valid
    ISO string subset but it often doesn't behave as expected. The result is
    often brittle, yielding "data driven exceptions" that we've tried to
    avoid.
    
    Numbers can also be ambiguous, e.g. is a Number passed for
    `offset` mean hours like an ISO string, minutes like
    Date.p.getTimezoneOffset, or msecs like Date.p.getTime().
    
    This commit also removes coercing objects to strings in the
    same contexts (like TimeZone and Calendar constructors) because
    it's unclear that there are use cases for this coercion.
    justingrant committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    944ad1a View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2023

  1. Update test262

    ptomato committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    54d5ce7 View commit details
    Browse the repository at this point in the history