Tracking for the Temporal built-in implementation
ECMASCript feature
The new Temporal API has been introduced to improve date handling in JavaScript, and we should add it to Boa to be up to date with the current ECMAScript standard. Tests have been added to the official ECMAScript Test Suite (test262), so we need to pass these tests to get full coverage.
The current proposal (Stage 3) specification can be found here: https://tc39.es/proposal-temporal/
In order to implement this new proposal, you can follow the example of other builtin objects, and feel free to ask for help: https://github.com/boa-dev/boa/tree/main/boa/src/builtins
Example code
This code should now work and give the expected result:
// exact time since the Unix epoch on 1 Janary, 1970 UTC
Temporal.now.instant();
Temporal.now.instant().epochSeconds;
Temporal.now.instant().epochMilliseconds;
// current time zone
Temporal.now.timeZone();
// time in current location, e.g.
// 2021-09-18T04:17:48.435068431-04:00[America/New_York]
Temporal.now.zonedDateTimeISO();
// time in another time zone, e.g.
// 2021-09-18T09:17:48.438068435+01:00[Europe/London]
Temporal.now.zonedDateTimeISO('Europe/London');
Tracking for the
Temporalbuilt-in implementationboa_temporalcrate (MigrateTemporalto its own crate. #3461)Temporal.Duration(Tracking issue for Temporal Duration object #4070)Temporal.PlainDate(Tracking issue for Temporal PlainDate object #4071)Temporal.Instant(Tracking issue for Temporal Instant object #4074)Temporal.PlainDateTime(Tracking issue for Temporal PlainDateTime object #4072)Temporal.PlainYearMonth(Tracking issue for Temporal YearMonth object #4077)Temporal.PlainMonthDay(Tracking issue for Temporal MonthDay object #4076)Temporal.PlainTimemethods and operations (Tracking issue for Temporal PlainTime object #4073)Implement(Removed from the Temporal Proposal Mid 2024)Temporal.TimeZonemethods and operationsTemporal.ZonedDateTimemethods and operations (Tracking issue for Temporal ZonedDateTime object #4075)Temporal.Now(dependent onTemporal.Instant,Temporal.DateTimeandTemporal.ZonedDateTime)ECMASCript feature
The new
TemporalAPI has been introduced to improve date handling in JavaScript, and we should add it to Boa to be up to date with the current ECMAScript standard. Tests have been added to the official ECMAScript Test Suite (test262), so we need to pass these tests to get full coverage.The current proposal (Stage 3) specification can be found here: https://tc39.es/proposal-temporal/
In order to implement this new proposal, you can follow the example of other builtin objects, and feel free to ask for help: https://github.com/boa-dev/boa/tree/main/boa/src/builtins
Example code
This code should now work and give the expected result: