@@ -35,116 +35,116 @@ void Now::initialize(GlobalObject& global_object)
35
35
define_direct_property (*vm.well_known_symbol_to_string_tag (), js_string (vm, " Temporal.Now" ), Attribute::Configurable);
36
36
37
37
u8 attr = Attribute::Writable | Attribute::Configurable;
38
- define_old_native_function (vm.names .timeZone , time_zone, 0 , attr);
39
- define_old_native_function (vm.names .instant , instant, 0 , attr);
40
- define_old_native_function (vm.names .plainDateTime , plain_date_time, 1 , attr);
41
- define_old_native_function (vm.names .plainDateTimeISO , plain_date_time_iso, 0 , attr);
42
- define_old_native_function (vm.names .zonedDateTime , zoned_date_time, 1 , attr);
43
- define_old_native_function (vm.names .zonedDateTimeISO , zoned_date_time_iso, 0 , attr);
44
- define_old_native_function (vm.names .plainDate , plain_date, 1 , attr);
45
- define_old_native_function (vm.names .plainDateISO , plain_date_iso, 0 , attr);
46
- define_old_native_function (vm.names .plainTimeISO , plain_time_iso, 0 , attr);
38
+ define_native_function (vm.names .timeZone , time_zone, 0 , attr);
39
+ define_native_function (vm.names .instant , instant, 0 , attr);
40
+ define_native_function (vm.names .plainDateTime , plain_date_time, 1 , attr);
41
+ define_native_function (vm.names .plainDateTimeISO , plain_date_time_iso, 0 , attr);
42
+ define_native_function (vm.names .zonedDateTime , zoned_date_time, 1 , attr);
43
+ define_native_function (vm.names .zonedDateTimeISO , zoned_date_time_iso, 0 , attr);
44
+ define_native_function (vm.names .plainDate , plain_date, 1 , attr);
45
+ define_native_function (vm.names .plainDateISO , plain_date_iso, 0 , attr);
46
+ define_native_function (vm.names .plainTimeISO , plain_time_iso, 0 , attr);
47
47
}
48
48
49
49
// 2.2.1 Temporal.Now.timeZone ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.timezone
50
- JS_DEFINE_OLD_NATIVE_FUNCTION (Now::time_zone)
50
+ JS_DEFINE_NATIVE_FUNCTION (Now::time_zone)
51
51
{
52
52
// 1. Return ! SystemTimeZone().
53
53
return system_time_zone (global_object);
54
54
}
55
55
56
56
// 2.2.2 Temporal.Now.instant ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.instant
57
- JS_DEFINE_OLD_NATIVE_FUNCTION (Now::instant)
57
+ JS_DEFINE_NATIVE_FUNCTION (Now::instant)
58
58
{
59
59
// 1. Return ! SystemInstant().
60
60
return system_instant (global_object);
61
61
}
62
62
63
63
// 2.2.3 Temporal.Now.plainDateTime ( calendar [ , temporalTimeZoneLike ] ), https://tc39.es/proposal-temporal/#sec-temporal.now.plaindatetime
64
- JS_DEFINE_OLD_NATIVE_FUNCTION (Now::plain_date_time)
64
+ JS_DEFINE_NATIVE_FUNCTION (Now::plain_date_time)
65
65
{
66
66
auto calendar = vm.argument (0 );
67
67
auto temporal_time_zone_like = vm.argument (1 );
68
68
69
69
// 1. Return ? SystemDateTime(temporalTimeZoneLike, calendar).
70
- return TRY_OR_DISCARD (system_date_time (global_object, temporal_time_zone_like, calendar));
70
+ return TRY (system_date_time (global_object, temporal_time_zone_like, calendar));
71
71
}
72
72
73
73
// 2.2.4 Temporal.Now.plainDateTimeISO ( [ temporalTimeZoneLike ] ), https://tc39.es/proposal-temporal/#sec-temporal.now.plaindatetimeiso
74
- JS_DEFINE_OLD_NATIVE_FUNCTION (Now::plain_date_time_iso)
74
+ JS_DEFINE_NATIVE_FUNCTION (Now::plain_date_time_iso)
75
75
{
76
76
auto temporal_time_zone_like = vm.argument (0 );
77
77
78
78
// 1, Let calendar be ! GetISO8601Calendar().
79
79
auto * calendar = get_iso8601_calendar (global_object);
80
80
81
81
// 2. Return ? SystemDateTime(temporalTimeZoneLike, calendar).
82
- return TRY_OR_DISCARD (system_date_time (global_object, temporal_time_zone_like, calendar));
82
+ return TRY (system_date_time (global_object, temporal_time_zone_like, calendar));
83
83
}
84
84
85
85
// 2.2.5 Temporal.Now.zonedDateTime ( calendar [ , temporalTimeZoneLike ] ), https://tc39.es/proposal-temporal/#sec-temporal.now.zoneddatetime
86
- JS_DEFINE_OLD_NATIVE_FUNCTION (Now::zoned_date_time)
86
+ JS_DEFINE_NATIVE_FUNCTION (Now::zoned_date_time)
87
87
{
88
88
auto calendar = vm.argument (0 );
89
89
auto temporal_time_zone_like = vm.argument (1 );
90
90
91
91
// 1. Return ? SystemZonedDateTime(temporalTimeZoneLike, calendar).
92
- return TRY_OR_DISCARD (system_zoned_date_time (global_object, temporal_time_zone_like, calendar));
92
+ return TRY (system_zoned_date_time (global_object, temporal_time_zone_like, calendar));
93
93
}
94
94
95
95
// 2.2.6 Temporal.Now.zonedDateTimeISO ( [ temporalTimeZoneLike ] ), https://tc39.es/proposal-temporal/#sec-temporal.now.zoneddatetimeiso
96
- JS_DEFINE_OLD_NATIVE_FUNCTION (Now::zoned_date_time_iso)
96
+ JS_DEFINE_NATIVE_FUNCTION (Now::zoned_date_time_iso)
97
97
{
98
98
auto temporal_time_zone_like = vm.argument (0 );
99
99
100
100
// 1, Let calendar be ! GetISO8601Calendar().
101
101
auto * calendar = get_iso8601_calendar (global_object);
102
102
103
103
// 2. Return ? SystemZonedDateTime(temporalTimeZoneLike, calendar).
104
- return TRY_OR_DISCARD (system_zoned_date_time (global_object, temporal_time_zone_like, calendar));
104
+ return TRY (system_zoned_date_time (global_object, temporal_time_zone_like, calendar));
105
105
}
106
106
107
107
// 2.2.7 Temporal.Now.plainDate ( calendar [ , temporalTimeZoneLike ] ), https://tc39.es/proposal-temporal/#sec-temporal.now.plaindate
108
- JS_DEFINE_OLD_NATIVE_FUNCTION (Now::plain_date)
108
+ JS_DEFINE_NATIVE_FUNCTION (Now::plain_date)
109
109
{
110
110
auto calendar = vm.argument (0 );
111
111
auto temporal_time_zone_like = vm.argument (1 );
112
112
113
113
// 1. Let dateTime be ? SystemDateTime(temporalTimeZoneLike, calendar).
114
- auto * date_time = TRY_OR_DISCARD (system_date_time (global_object, temporal_time_zone_like, calendar));
114
+ auto * date_time = TRY (system_date_time (global_object, temporal_time_zone_like, calendar));
115
115
116
116
// 2. Return ! CreateTemporalDate(dateTime.[[ISOYear]], dateTime.[[ISOMonth]], dateTime.[[ISODay]], dateTime.[[Calendar]]).
117
- return TRY_OR_DISCARD (create_temporal_date (global_object, date_time->iso_year (), date_time->iso_month (), date_time->iso_day (), date_time->calendar ()));
117
+ return TRY (create_temporal_date (global_object, date_time->iso_year (), date_time->iso_month (), date_time->iso_day (), date_time->calendar ()));
118
118
}
119
119
120
120
// 2.2.8 Temporal.Now.plainDateISO ( [ temporalTimeZoneLike ] ), https://tc39.es/proposal-temporal/#sec-temporal.now.plaindateiso
121
- JS_DEFINE_OLD_NATIVE_FUNCTION (Now::plain_date_iso)
121
+ JS_DEFINE_NATIVE_FUNCTION (Now::plain_date_iso)
122
122
{
123
123
auto temporal_time_zone_like = vm.argument (0 );
124
124
125
125
// 1. Let calendar be ! GetISO8601Calendar().
126
126
auto * calendar = get_iso8601_calendar (global_object);
127
127
128
128
// 2. Let dateTime be ? SystemDateTime(temporalTimeZoneLike, calendar).
129
- auto * date_time = TRY_OR_DISCARD (system_date_time (global_object, temporal_time_zone_like, calendar));
129
+ auto * date_time = TRY (system_date_time (global_object, temporal_time_zone_like, calendar));
130
130
131
131
// 3. Return ! CreateTemporalDate(dateTime.[[ISOYear]], dateTime.[[ISOMonth]], dateTime.[[ISODay]], dateTime.[[Calendar]]).
132
- return TRY_OR_DISCARD (create_temporal_date (global_object, date_time->iso_year (), date_time->iso_month (), date_time->iso_day (), date_time->calendar ()));
132
+ return TRY (create_temporal_date (global_object, date_time->iso_year (), date_time->iso_month (), date_time->iso_day (), date_time->calendar ()));
133
133
}
134
134
135
135
// 2.2.9 Temporal.Now.plainTimeISO ( [ temporalTimeZoneLike ] ), https://tc39.es/proposal-temporal/#sec-temporal.now.plaintimeiso
136
- JS_DEFINE_OLD_NATIVE_FUNCTION (Now::plain_time_iso)
136
+ JS_DEFINE_NATIVE_FUNCTION (Now::plain_time_iso)
137
137
{
138
138
auto temporal_time_zone_like = vm.argument (0 );
139
139
140
140
// 1. Let calendar be ! GetISO8601Calendar().
141
141
auto * calendar = get_iso8601_calendar (global_object);
142
142
143
143
// 2. Let dateTime be ? SystemDateTime(temporalTimeZoneLike, calendar).
144
- auto * date_time = TRY_OR_DISCARD (system_date_time (global_object, temporal_time_zone_like, calendar));
144
+ auto * date_time = TRY (system_date_time (global_object, temporal_time_zone_like, calendar));
145
145
146
146
// 3. Return ! CreateTemporalTime(dateTime.[[ISOHour]], dateTime.[[ISOMinute]], dateTime.[[ISOSecond]], dateTime.[[ISOMillisecond]], dateTime.[[ISOMicrosecond]], dateTime.[[ISONanosecond]]).
147
- return TRY_OR_DISCARD (create_temporal_time (global_object, date_time->iso_hour (), date_time->iso_minute (), date_time->iso_second (), date_time->iso_millisecond (), date_time->iso_microsecond (), date_time->iso_nanosecond ()));
147
+ return MUST (create_temporal_time (global_object, date_time->iso_hour (), date_time->iso_minute (), date_time->iso_second (), date_time->iso_millisecond (), date_time->iso_microsecond (), date_time->iso_nanosecond ()));
148
148
}
149
149
150
150
// 2.3.1 SystemTimeZone ( ), https://tc39.es/proposal-temporal/#sec-temporal-systemtimezone
@@ -154,7 +154,7 @@ TimeZone* system_time_zone(GlobalObject& global_object)
154
154
auto identifier = default_time_zone ();
155
155
156
156
// 2. Return ! CreateTemporalTimeZone(identifier).
157
- return TRY_OR_DISCARD (create_temporal_time_zone (global_object, identifier));
157
+ return MUST (create_temporal_time_zone (global_object, identifier));
158
158
}
159
159
160
160
// 2.3.2 SystemUTCEpochNanoseconds ( ), https://tc39.es/proposal-temporal/#sec-temporal-systemutcepochnanoseconds
0 commit comments