@@ -23,6 +23,15 @@ impl Builtin for TemporalPlainTimePrototypeGetMinute {
2323}
2424impl BuiltinGetter for TemporalPlainTimePrototypeGetMinute { }
2525
26+ struct TemporalPlainTimePrototypeGetSecond ;
27+ impl Builtin for TemporalPlainTimePrototypeGetSecond {
28+ const NAME : String < ' static > = BUILTIN_STRING_MEMORY . get_second ;
29+ const KEY : Option < PropertyKey < ' static > > = Some ( BUILTIN_STRING_MEMORY . second . to_property_key ( ) ) ;
30+ const LENGTH : u8 = 0 ;
31+ const BEHAVIOUR : Behaviour = Behaviour :: Regular ( TemporalPlainTimePrototype :: get_second) ;
32+ }
33+ impl BuiltinGetter for TemporalPlainTimePrototypeGetSecond { }
34+
2635impl TemporalPlainTimePrototype {
2736 /// ### [4.3.4 get Temporal.PlainTime.prototype.minute](https://tc39.es/proposal-temporal/#sec-get-temporal.plaintime.prototype.minute)
2837 pub ( crate ) fn get_minute < ' gc > (
@@ -39,6 +48,21 @@ impl TemporalPlainTimePrototype {
3948 let value = plain_time. inner_plain_time ( agent) . minute ( ) ;
4049 Ok ( value. into ( ) )
4150 }
51+ /// ### [4.3.5 get Temporal.PlainTime.prototype.second](https://tc39.es/proposal-temporal/#sec-get-temporal.plaintime.prototype.second)
52+ pub ( crate ) fn get_second < ' gc > (
53+ agent : & mut Agent ,
54+ this_value : Value ,
55+ _: ArgumentsList ,
56+ gc : GcScope < ' gc , ' _ > ,
57+ ) -> JsResult < ' gc , Value < ' gc > > {
58+ let gc = gc. into_nogc ( ) ;
59+ // 1. Let plainTime be the this value.
60+ // 2. Perform ? RequireInternalSlot(plainTime, [[InitializedTemporalTime]]).
61+ let plain_time = require_internal_slot_temporal_plain_time ( agent, this_value, gc) ?;
62+ // 3. Return 𝔽(plainTime.[[Time]].[[Second]]).
63+ let value = plain_time. inner_plain_time ( agent) . second ( ) ;
64+ Ok ( value. into ( ) )
65+ }
4266
4367 pub ( crate ) fn create_intrinsic ( agent : & mut Agent , realm : Realm < ' static > , _: NoGcScope ) {
4468 let intrinsics = agent. get_realm_record_by_id ( realm) . intrinsics ( ) ;
@@ -47,10 +71,11 @@ impl TemporalPlainTimePrototype {
4771 let plain_time_constructor = intrinsics. temporal_plain_time ( ) ;
4872
4973 OrdinaryObjectBuilder :: new_intrinsic_object ( agent, realm, this)
50- . with_property_capacity ( 3 )
74+ . with_property_capacity ( 4 )
5175 . with_prototype ( object_prototype)
5276 . with_constructor_property ( plain_time_constructor)
5377 . with_builtin_function_getter_property :: < TemporalPlainTimePrototypeGetMinute > ( )
78+ . with_builtin_function_getter_property :: < TemporalPlainTimePrototypeGetSecond > ( )
5479 . with_property ( |builder| {
5580 builder
5681 . with_key ( WellKnownSymbols :: ToStringTag . into ( ) )
0 commit comments