Skip to content

feat(ecmascript): Temporal.PlainTime constructor#965

Open
jesperkha wants to merge 3 commits intotrynova:mainfrom
jesperkha:constructor
Open

feat(ecmascript): Temporal.PlainTime constructor#965
jesperkha wants to merge 3 commits intotrynova:mainfrom
jesperkha:constructor

Conversation

@jesperkha
Copy link
Contributor

No description provided.

Add create_temporal_plain_time
let h = if hours.get(agent).is_undefined() {
Ok(0)
} else {
u8::try_from(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Let's end all of the try_from's with an unwrap_or(u8/u16::MAX), and replace Ok(0)s with just 0.


// 8. If IsValidTime(hour, minute, second, millisecond, microsecond, nanosecond) is false, throw a RangeError exception.
// 9. Let time be CreateTimeRecord(hour, minute, second, millisecond, microsecond, nanosecond).
let time = if let (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Here splitting into the else branch becomes unnecessary after adding unwrap_or(...) to each of the above else-branches.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants