mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibJS: Implement Temporal.PlainYearMonth.prototype.until/since
This commit is contained in:
parent
203269fae2
commit
cb5d1b5086
Notes:
github-actions[bot]
2024-11-22 18:56:30 +00:00
Author: https://github.com/trflynn89
Commit: cb5d1b5086
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2496
26 changed files with 1586 additions and 1 deletions
|
@ -34,4 +34,17 @@ Crypto::UnsignedBigInteger const SECONDS_PER_MINUTE = 60_bigint;
|
|||
Crypto::UnsignedBigInteger const MINUTES_PER_HOUR = 60_bigint;
|
||||
Crypto::UnsignedBigInteger const HOURS_PER_DAY = 24_bigint;
|
||||
|
||||
// 8.5.1 IsValidEpochNanoseconds ( epochNanoseconds ), https://tc39.es/proposal-temporal/#sec-temporal-isvalidepochnanoseconds
|
||||
bool is_valid_epoch_nanoseconds(Crypto::SignedBigInteger const& epoch_nanoseconds)
|
||||
{
|
||||
// 1. If ℝ(epochNanoseconds) < nsMinInstant or ℝ(epochNanoseconds) > nsMaxInstant, then
|
||||
if (epoch_nanoseconds < NANOSECONDS_MIN_INSTANT || epoch_nanoseconds > NANOSECONDS_MAX_INSTANT) {
|
||||
// a. Return false.
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2. Return true.
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue