Skip to content

Parsing issue for fractional time string exceeding nine digits #677

@fabon-f

Description

@fabon-f
Temporal.Instant.from('2020-01-01T00:00:00.1234567890Z');
Temporal.PlainDate.from('2020-01-01T00:00:00.1234567890');
Temporal.PlainYearMonth.from('2020-01-01T00:00:00.1234567890');
Temporal.PlainMonthDay.from('2020-01-01T00:00:00.1234567890');

Every statement should raise an error according to the spec, but this crate doesn't.

https://tc39.es/ecma262/multipage/numbers-and-dates.html#prod-TemporalDecimalFraction

Note that PlainTime, ZonedDateTime and PlainDateTime rejects such kind of invalid strings.

Temporal.PlainTime.from('2020-01-01T00:00:00.1234567890');
Temporal.ZonedDateTime.from('2020-01-01T00:00:00.1234567890Z[UTC]');
Temporal.PlainDateTime.from('2020-01-01T00:00:00.1234567890');

I confirmed this behavior in both Boa v0.21 (in playground) and Chrome Canary.

original bug report post (in Japanese)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions