mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
LibJS: Reflect naming consistency editorial changes in the Temporal spec
See: -2aa7dce
-13daa33
-8085873
This commit is contained in:
parent
c4de2bb5e5
commit
092f924cfd
3 changed files with 17 additions and 17 deletions
|
@ -357,8 +357,8 @@ JS_DEFINE_NATIVE_FUNCTION(PlainDateTimePrototype::in_leap_year_getter)
|
|||
// 5.3.24 Temporal.PlainDateTime.prototype.withPlainDate ( plainDateLike ), https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype.withplaindate
|
||||
JS_DEFINE_NATIVE_FUNCTION(PlainDateTimePrototype::with_plain_date)
|
||||
{
|
||||
// 1. Let temporalDateTime be the this value.
|
||||
// 2. Perform ? RequireInternalSlot(temporalDateTime, [[InitializedTemporalDateTime]]).
|
||||
// 1. Let dateTime be the this value.
|
||||
// 2. Perform ? RequireInternalSlot(dateTime, [[InitializedTemporalDateTime]]).
|
||||
auto* date_time = typed_this(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
@ -368,20 +368,20 @@ JS_DEFINE_NATIVE_FUNCTION(PlainDateTimePrototype::with_plain_date)
|
|||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
// 4. Let calendar be ? ConsolidateCalendars(temporalDateTime.[[Calendar]], plainDate.[[Calendar]]).
|
||||
// 4. Let calendar be ? ConsolidateCalendars(dateTime.[[Calendar]], plainDate.[[Calendar]]).
|
||||
auto* calendar = consolidate_calendars(global_object, date_time->calendar(), plain_date->calendar());
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
// 5. Return ? CreateTemporalDateTime(plainDate.[[ISOYear]], plainDate.[[ISOMonth]], plainDate.[[ISODay]], temporalDateTime.[[ISOHour]], temporalDateTime.[[ISOMinute]], temporalDateTime.[[ISOSecond]], temporalDateTime.[[ISOMillisecond]], temporalDateTime.[[ISOMicrosecond]], temporalDateTime.[[ISONanosecond]], calendar).
|
||||
// 5. Return ? CreateTemporalDateTime(plainDate.[[ISOYear]], plainDate.[[ISOMonth]], plainDate.[[ISODay]], dateTime.[[ISOHour]], dateTime.[[ISOMinute]], dateTime.[[ISOSecond]], dateTime.[[ISOMillisecond]], dateTime.[[ISOMicrosecond]], dateTime.[[ISONanosecond]], calendar).
|
||||
return create_temporal_date_time(global_object, plain_date->iso_year(), plain_date->iso_month(), plain_date->iso_day(), date_time->iso_hour(), date_time->iso_minute(), date_time->iso_second(), date_time->iso_millisecond(), date_time->iso_microsecond(), date_time->iso_nanosecond(), *calendar);
|
||||
}
|
||||
|
||||
// 5.3.25 Temporal.PlainDateTime.prototype.withCalendar ( calendar ), https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype.withcalendar
|
||||
JS_DEFINE_NATIVE_FUNCTION(PlainDateTimePrototype::with_calendar)
|
||||
{
|
||||
// 1. Let temporalDateTime be the this value.
|
||||
// 2. Perform ? RequireInternalSlot(temporalDateTime, [[InitializedTemporalDateTime]]).
|
||||
// 1. Let dateTime be the this value.
|
||||
// 2. Perform ? RequireInternalSlot(dateTime, [[InitializedTemporalDateTime]]).
|
||||
auto* date_time = typed_this(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
@ -391,7 +391,7 @@ JS_DEFINE_NATIVE_FUNCTION(PlainDateTimePrototype::with_calendar)
|
|||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
// 4. Return ? CreateTemporalDateTime(temporalDateTime.[[ISOYear]], temporalDateTime.[[ISOMonth]], temporalDateTime.[[ISODay]], temporalDateTime.[[ISOHour]], temporalDateTime.[[ISOMinute]], temporalDateTime.[[ISOSecond]], temporalDateTime.[[ISOMillisecond]], temporalDateTime.[[ISOMicrosecond]], temporalDateTime.[[ISONanosecond]], calendar).
|
||||
// 4. Return ? CreateTemporalDateTime(dateTime.[[ISOYear]], dateTime.[[ISOMonth]], dateTime.[[ISODay]], dateTime.[[ISOHour]], dateTime.[[ISOMinute]], dateTime.[[ISOSecond]], dateTime.[[ISOMillisecond]], dateTime.[[ISOMicrosecond]], dateTime.[[ISONanosecond]], calendar).
|
||||
return create_temporal_date_time(global_object, date_time->iso_year(), date_time->iso_month(), date_time->iso_day(), date_time->iso_hour(), date_time->iso_minute(), date_time->iso_second(), date_time->iso_millisecond(), date_time->iso_microsecond(), date_time->iso_nanosecond(), *calendar);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,14 +52,14 @@ static PlainMonthDay* typed_this(GlobalObject& global_object)
|
|||
// 10.3.3 get Temporal.PlainMonthDay.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plainmonthday.prototype.calendar
|
||||
JS_DEFINE_NATIVE_FUNCTION(PlainMonthDayPrototype::calendar_getter)
|
||||
{
|
||||
// 1. Let plainMonthDay be the this value.
|
||||
// 2. Perform ? RequireInternalSlot(plainMonthDay, [[InitializedTemporalMonthDay]]).
|
||||
auto* plain_month_day = typed_this(global_object);
|
||||
// 1. Let monthDay be the this value.
|
||||
// 2. Perform ? RequireInternalSlot(monthDay, [[InitializedTemporalMonthDay]]).
|
||||
auto* month_day = typed_this(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
// 3. Return plainMonthDay.[[Calendar]].
|
||||
return Value(&plain_month_day->calendar());
|
||||
// 3. Return monthDay.[[Calendar]].
|
||||
return Value(&month_day->calendar());
|
||||
}
|
||||
|
||||
// 10.3.4 get Temporal.PlainMonthDay.prototype.monthCode, https://tc39.es/proposal-temporal/#sec-get-temporal.plainmonthday.prototype.monthcode
|
||||
|
|
|
@ -57,14 +57,14 @@ static PlainYearMonth* typed_this(GlobalObject& global_object)
|
|||
// 9.3.3 get Temporal.PlainYearMonth.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plainyearmonth.prototype.calendar
|
||||
JS_DEFINE_NATIVE_FUNCTION(PlainYearMonthPrototype::calendar_getter)
|
||||
{
|
||||
// 1. Let plainYearMonth be the this value.
|
||||
// 2. Perform ? RequireInternalSlot(plainYearMonth, [[InitializedTemporalYearMonth]]).
|
||||
auto* plain_year_month = typed_this(global_object);
|
||||
// 1. Let yearMonth be the this value.
|
||||
// 2. Perform ? RequireInternalSlot(yearMonth, [[InitializedTemporalYearMonth]]).
|
||||
auto* year_month = typed_this(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
// 3. Return plainYearMonth.[[Calendar]].
|
||||
return Value(&plain_year_month->calendar());
|
||||
// 3. Return yearMonth.[[Calendar]].
|
||||
return Value(&year_month->calendar());
|
||||
}
|
||||
|
||||
// 9.3.4 get Temporal.PlainYearMonth.prototype.year, https://tc39.es/proposal-temporal/#sec-get-temporal.plainyearmonth.prototype.year
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue