Skip to content

feat(ecmascript): PlainTime.prototype.since + until#981

Draft
0Zeno wants to merge 1 commit intotrynova:mainfrom
jesperkha:temporal/plaintime-prototype-until-since
Draft

feat(ecmascript): PlainTime.prototype.since + until#981
0Zeno wants to merge 1 commit intotrynova:mainfrom
jesperkha:temporal/plaintime-prototype-until-since

Conversation

@0Zeno
Copy link
Copy Markdown
Contributor

@0Zeno 0Zeno commented Apr 14, 2026

No description provided.

Agent, ArgumentsList, BUILTIN_STRING_MEMORY, Behaviour, Builtin, BuiltinGetter, JsResult,
PropertyKey, Realm, String, Value, builders::OrdinaryObjectBuilder,
builtins::temporal::plain_time::require_internal_slot_temporal_plain_time,
builtins::temporal::plain_time::{self, require_internal_slot_temporal_plain_time},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nitpick: self import accidentally. These like to appear.

// a. If item has an [[InitializedTemporalTime]] internal slot, then
if let Ok(time) = TemporalPlainTime::try_from(item) {
// i. Let resolvedOptions be ? GetOptionsObject(options).
let resolved_options = get_options_object(agent, options, gc.reborrow()).unbind()?;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

issue: GC can happen on this line and the line below: that would invalidate time. This shouldn't even pass compilation since item should be correctly bound here.

}

// b. If item has an [[InitializedTemporalDateTime]] internal slot, then
if let Ok(dt) = TemporalPlainTime::try_from(item) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

issue: Remove these code lines - leave the comment lines. We don't have DateTime and ZonedDateTime yet.

let Ok(item) = String::try_from(item) else {
return Err(agent.throw_exception_with_static_message(
ExceptionType::TypeError,
"Item is not a String",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nitpick: Message could be better.

// 1. Set other to ? ToTemporalTime(other).
let other = to_temporal_time(agent, other.unbind(), gc.reborrow());
// 2. Let resolvedOptions be ? GetOptionsObject(options).
let resolved_option = get_options_object(agent, options.get(agent), gc.nogc())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nitpick: You can take options here.

@aapoalas aapoalas changed the title echmascript(temporal): PlainTime.prototype.since + until feat(ecmascript): PlainTime.prototype.since + until Apr 14, 2026
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