From bfd52f99cef549d4f878e7fce4617cbd3cfcc4f7 Mon Sep 17 00:00:00 2001 From: HyukWoo Park Date: Tue, 10 Dec 2024 16:44:05 +0900 Subject: [PATCH 1/2] Refactor static strings for Temporal * redefine all lazy strings of Temporal objects Signed-off-by: HyukWoo Park --- src/builtins/BuiltinTemporal.cpp | 448 +++++++++++++++---------------- src/runtime/StaticStrings.cpp | 2 - src/runtime/StaticStrings.h | 156 +++++------ src/runtime/Temporal.h | 12 +- src/runtime/TemporalObject.cpp | 128 ++++----- 5 files changed, 373 insertions(+), 373 deletions(-) diff --git a/src/builtins/BuiltinTemporal.cpp b/src/builtins/BuiltinTemporal.cpp index 9b7004b1e..f8d601173 100644 --- a/src/builtins/BuiltinTemporal.cpp +++ b/src/builtins/BuiltinTemporal.cpp @@ -400,12 +400,12 @@ static Value builtinTemporalPlainTimeGetISOFields(ExecutionState& state, Value t TemporalPlainTimeObject* temporalTime = thisValue.asObject()->asTemporalPlainTimeObject(); auto fields = new Object(state); fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().calendar), ObjectPropertyDescriptor(temporalTime->getCalendar(), ObjectPropertyDescriptor::AllPresent)); - fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyisoHour()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getHour()).c_str())), ObjectPropertyDescriptor::AllPresent)); - fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyisoMicrosecond()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getMicrosecond()).c_str())), ObjectPropertyDescriptor::AllPresent)); - fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyisoMillisecond()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getMillisecond()).c_str())), ObjectPropertyDescriptor::AllPresent)); - fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyisoMinute()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getMinute()).c_str())), ObjectPropertyDescriptor::AllPresent)); - fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyisoNanosecond()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getNanosecond()).c_str())), ObjectPropertyDescriptor::AllPresent)); - fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyisoSecond()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getSecond()).c_str())), ObjectPropertyDescriptor::AllPresent)); + fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyIsoHour()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getHour()).c_str())), ObjectPropertyDescriptor::AllPresent)); + fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyIsoMicrosecond()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getMicrosecond()).c_str())), ObjectPropertyDescriptor::AllPresent)); + fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyIsoMillisecond()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getMillisecond()).c_str())), ObjectPropertyDescriptor::AllPresent)); + fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyIsoMinute()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getMinute()).c_str())), ObjectPropertyDescriptor::AllPresent)); + fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyIsoNanosecond()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getNanosecond()).c_str())), ObjectPropertyDescriptor::AllPresent)); + fields->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().lazyIsoSecond()), ObjectPropertyDescriptor(Value(new ASCIIString(std::to_string(temporalTime->getSecond()).c_str())), ObjectPropertyDescriptor::AllPresent)); return fields; } @@ -731,8 +731,8 @@ static Value builtinTemporalZonedDateTimeHoursInDay(ExecutionState& state, Value auto today = TemporalPlainDateTimeObject::createTemporalDateTime(state, temporalDateTime->getYear(), temporalDateTime->getMonth(), temporalDateTime->getDay(), 0, 0, 0, 0, 0, 0, TemporalCalendarObject::getISO8601Calendar(state)); auto tomorrowFields = TemporalPlainDateObject::balanceISODate(state, temporalDateTime->getYear(), temporalDateTime->getMonth(), temporalDateTime->getDay() + 1); auto tomorrow = TemporalPlainDateTimeObject::createTemporalDateTime(state, tomorrowFields[TemporalObject::YEAR_UNIT], tomorrowFields[TemporalObject::MONTH_UNIT], tomorrowFields[TemporalObject::DAY_UNIT], 0, 0, 0, 0, 0, 0, TemporalCalendarObject::getISO8601Calendar(state)); - auto todayInstant = TemporalTimeZoneObject::builtinTimeZoneGetInstantFor(state, thisValue.asObject()->asTemporalZonedDateTimeObject()->getTimeZone(), today, Value(state.context()->staticStrings().lazycompatible().string())); - auto tomorrowInstant = TemporalTimeZoneObject::builtinTimeZoneGetInstantFor(state, thisValue.asObject()->asTemporalZonedDateTimeObject()->getTimeZone(), tomorrow, Value(state.context()->staticStrings().lazycompatible().string())); + auto todayInstant = TemporalTimeZoneObject::builtinTimeZoneGetInstantFor(state, thisValue.asObject()->asTemporalZonedDateTimeObject()->getTimeZone(), today, Value(state.context()->staticStrings().lazyCompatible().string())); + auto tomorrowInstant = TemporalTimeZoneObject::builtinTimeZoneGetInstantFor(state, thisValue.asObject()->asTemporalZonedDateTimeObject()->getTimeZone(), tomorrow, Value(state.context()->staticStrings().lazyCompatible().string())); return Value(tomorrowInstant.asObject()->asTemporalInstantObject()->getNanoseconds()->subtraction(state, todayInstant.asObject()->asTemporalZonedDateTimeObject()->getNanoseconds())->division(state, new BigInt(TemporalInstantObject::HourToNanosecond))); } @@ -1653,10 +1653,10 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), dateMonthDesc); JSGetterSetter dateMonthCodeGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthCode(), builtinTemporalPlainDateMonthCode, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalPlainDateMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateMonthCodeDesc(dateMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthCode()), dateMonthCodeDesc); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), dateMonthCodeDesc); JSGetterSetter dateDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalPlainDateDay, 0, NativeFunctionInfo::Strict)), @@ -1665,58 +1665,58 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), dateDayDesc); JSGetterSetter dateDayOfWeekGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfWeek(), builtinTemporalPlainDateDayOfWeek, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalPlainDateDayOfWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDayOfWeekDesc(dateDayOfWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfWeek()), dateDayOfWeekDesc); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), dateDayOfWeekDesc); JSGetterSetter dateDayOfYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfYear(), builtinTemporalPlainDateDayOfYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalPlainDateDayOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDayOfYearDesc(dateDayOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfYear()), dateDayOfYearDesc); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), dateDayOfYearDesc); JSGetterSetter dateWeekOfYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyweekOfYear(), builtinTemporalPlainDateWeekOfYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalPlainDateWeekOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateWeekOfYearDesc(dateWeekOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyweekOfYear()), dateWeekOfYearDesc); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), dateWeekOfYearDesc); JSGetterSetter dateDaysInWeekGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInWeek(), builtinTemporalPlainDateDaysInWeek, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalPlainDateDaysInWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDaysInWeekDesc(dateDaysInWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInWeek()), dateDaysInWeekDesc); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), dateDaysInWeekDesc); JSGetterSetter dateDaysInMonthGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInMonth(), builtinTemporalPlainDateDaysInMonth, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalPlainDateDaysInMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDaysInMonthDesc(dateDaysInMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInMonth()), dateDaysInMonthDesc); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), dateDaysInMonthDesc); JSGetterSetter dateDaysInYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInYear(), builtinTemporalPlainDateDaysInYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalPlainDateDaysInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDaysInYearDesc(dateDaysInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInYear()), dateDaysInYearDesc); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), dateDaysInYearDesc); JSGetterSetter dateMonthsInYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthsInYear(), builtinTemporalPlainDateMonthsInYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalPlainDateMonthsInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateMonthsInYearDesc(dateMonthsInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthsInYear()), dateMonthsInYearDesc); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), dateMonthsInYearDesc); JSGetterSetter dateInLeapYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyinLeapYear(), builtinTemporalPlainDateInLeapYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalPlainDateInLeapYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateInLeapYearDesc(dateInLeapYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyinLeapYear()), dateInLeapYearDesc); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), dateInLeapYearDesc); temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainDatePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazysubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazysubtract(), builtinTemporalPlainDatePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainDatePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalPlainDate->setFunctionPrototype(state, temporalPlainDatePrototype); @@ -1762,40 +1762,40 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySecond()), timeSecondDesc); JSGetterSetter timeMilliSecondGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymillisecond(), builtinTemporalPlainTimeMilliSecond, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMillisecond(), builtinTemporalPlainTimeMilliSecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeMilliSecondDesc(timeMilliSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymillisecond()), timeMilliSecondDesc); + temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMillisecond()), timeMilliSecondDesc); JSGetterSetter timeMicroSecondGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymicrosecond(), builtinTemporalPlainTimeMicroSecond, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMicrosecond(), builtinTemporalPlainTimeMicroSecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeMicroSecondDesc(timeMicroSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymicrosecond()), timeMicroSecondDesc); + temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMicrosecond()), timeMicroSecondDesc); JSGetterSetter timeNanoSecondGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazynanosecond(), builtinTemporalPlainTimeNanoSecond, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyNanosecond(), builtinTemporalPlainTimeNanoSecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeNanoSecondDesc(timeNanoSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazynanosecond()), timeNanoSecondDesc); + temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNanosecond()), timeNanoSecondDesc); temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainTimePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazysubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazysubtract(), builtinTemporalPlainTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->with), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->with, builtinTemporalPlainTimeWith, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyequals()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyequals(), builtinTemporalPlainTimeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEquals()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEquals(), builtinTemporalPlainTimeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazygetISOFields()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazygetISOFields(), builtinTemporalPlainTimeGetISOFields, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetISOFields()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetISOFields(), builtinTemporalPlainTimeGetISOFields, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazytoPlainDateTime()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazytoPlainDateTime(), builtinTemporalPlainTimeToPlainDateTime, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyToPlainDateTime()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyToPlainDateTime(), builtinTemporalPlainTimeToPlainDateTime, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalPlainTime->setFunctionPrototype(state, temporalPlainTimePrototype); @@ -1827,10 +1827,10 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), dateTimeMonthDesc); JSGetterSetter dateTimeMonthCodeGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthCode(), builtinTemporalPlainDateTimeMonthCode, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalPlainDateTimeMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeMonthCodeDesc(dateTimeMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthCode()), dateTimeMonthCodeDesc); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), dateTimeMonthCodeDesc); JSGetterSetter dateTimeDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalPlainDateTimeDay, 0, NativeFunctionInfo::Strict)), @@ -1839,58 +1839,58 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), dateTimeDayDesc); JSGetterSetter dateTimeDayOfWeekGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfWeek(), builtinTemporalPlainDateTimeDayOfWeek, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalPlainDateTimeDayOfWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDayOfWeekDesc(dateTimeDayOfWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfWeek()), dateTimeDayOfWeekDesc); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), dateTimeDayOfWeekDesc); JSGetterSetter dateTimeDayOfYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfYear(), builtinTemporalPlainDateTimeDayOfYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalPlainDateTimeDayOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDayOfYearDesc(dateTimeDayOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfYear()), dateTimeDayOfYearDesc); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), dateTimeDayOfYearDesc); JSGetterSetter dateTimeWeekOfYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyweekOfYear(), builtinTemporalPlainDateTimeWeekOfYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalPlainDateTimeWeekOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeWeekOfYearDesc(dateTimeWeekOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyweekOfYear()), dateTimeWeekOfYearDesc); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), dateTimeWeekOfYearDesc); JSGetterSetter dateTimeDaysInWeekGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInWeek(), builtinTemporalPlainDateTimeDaysInWeek, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalPlainDateTimeDaysInWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDaysInWeekDesc(dateTimeDaysInWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInWeek()), dateTimeDaysInWeekDesc); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), dateTimeDaysInWeekDesc); JSGetterSetter dateTimeDaysInMonthGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInMonth(), builtinTemporalPlainDateTimeDaysInMonth, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalPlainDateTimeDaysInMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDaysInMonthDesc(dateTimeDaysInMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInMonth()), dateTimeDaysInMonthDesc); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), dateTimeDaysInMonthDesc); JSGetterSetter dateTimeDaysInYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInYear(), builtinTemporalPlainDateTimeDaysInYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalPlainDateTimeDaysInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDaysInYearDesc(dateTimeDaysInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInYear()), dateTimeDaysInYearDesc); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), dateTimeDaysInYearDesc); JSGetterSetter dateTimeMonthsInYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthsInYear(), builtinTemporalPlainDateTimeMonthsInYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalPlainDateTimeMonthsInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeMonthsInYearDesc(dateTimeMonthsInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthsInYear()), dateTimeMonthsInYearDesc); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), dateTimeMonthsInYearDesc); JSGetterSetter dateTimeInLeapYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyinLeapYear(), builtinTemporalPlainDateTimeInLeapYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalPlainDateTimeInLeapYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeInLeapYearDesc(dateTimeInLeapYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyinLeapYear()), dateTimeInLeapYearDesc); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), dateTimeInLeapYearDesc); temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainDateTimePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazysubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazysubtract(), builtinTemporalPlainDateTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainDateTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalPlainDateTime->setFunctionPrototype(state, temporalPlainDateTimePrototype); @@ -1912,10 +1912,10 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), zonedDateTimeCalendarDesc); JSGetterSetter zonedDateTimeTimeZoneGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazytimeZone(), builtinTemporalZonedDateTimeTimeZone, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyTimeZone(), builtinTemporalZonedDateTimeTimeZone, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeTimeZoneDesc(zonedDateTimeTimeZoneGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazytimeZone()), zonedDateTimeTimeZoneDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyTimeZone()), zonedDateTimeTimeZoneDesc); JSGetterSetter zonedDateTimeYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYear(), builtinTemporalZonedDateTimeYear, 0, NativeFunctionInfo::Strict)), @@ -1930,10 +1930,10 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), zonedDateTimeMonthDesc); JSGetterSetter zonedDateTimeMonthCodeGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthCode(), builtinTemporalZonedDateTimeMonthCode, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalZonedDateTimeMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMonthCodeDesc(zonedDateTimeMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthCode()), zonedDateTimeMonthCodeDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), zonedDateTimeMonthCodeDesc); JSGetterSetter zonedDateTimeDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalZonedDateTimeDay, 0, NativeFunctionInfo::Strict)), @@ -1960,118 +1960,118 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySecond()), zonedDateTimeSecondDesc); JSGetterSetter zonedDateTimeMillisecondGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymillisecond(), builtinTemporalZonedDateTimeMillisecond, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMillisecond(), builtinTemporalZonedDateTimeMillisecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMillisecondDesc(zonedDateTimeMillisecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymillisecond()), zonedDateTimeMillisecondDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMillisecond()), zonedDateTimeMillisecondDesc); JSGetterSetter zonedDateTimeMicrosecondGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymicrosecond(), builtinTemporalZonedDateTimeMicrosecond, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMicrosecond(), builtinTemporalZonedDateTimeMicrosecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMicrosecondDesc(zonedDateTimeMicrosecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymicrosecond()), zonedDateTimeMicrosecondDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMicrosecond()), zonedDateTimeMicrosecondDesc); JSGetterSetter zonedDateTimeNanosecondGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazynanosecond(), builtinTemporalZonedDateTimeNanosecond, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyNanosecond(), builtinTemporalZonedDateTimeNanosecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeNanosecondDesc(zonedDateTimeNanosecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazynanosecond()), zonedDateTimeNanosecondDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNanosecond()), zonedDateTimeNanosecondDesc); JSGetterSetter zonedDateTimeEpochSecondGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyepochSeconds(), builtinTemporalZonedDateTimeEpochSeconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochSeconds(), builtinTemporalZonedDateTimeEpochSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeEpochSecondsDesc(zonedDateTimeEpochSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyepochSeconds()), zonedDateTimeEpochSecondsDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochSeconds()), zonedDateTimeEpochSecondsDesc); JSGetterSetter zonedDateTimeEpochMillisecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyepochMicroseconds(), builtinTemporalZonedDateTimeEpochMicroSeconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochMicroseconds(), builtinTemporalZonedDateTimeEpochMicroSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeEpochMillisecondsDesc(zonedDateTimeEpochMillisecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyepochMicroseconds()), zonedDateTimeEpochMillisecondsDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMicroseconds()), zonedDateTimeEpochMillisecondsDesc); JSGetterSetter zonedDateTimeEpochMicrosecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyepochMilliseconds(), builtinTemporalZonedDateTimeEpochMilliSeconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochMilliseconds(), builtinTemporalZonedDateTimeEpochMilliSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeEpochMicrosecondsDesc(zonedDateTimeEpochMicrosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyepochMilliseconds()), zonedDateTimeEpochMicrosecondsDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMilliseconds()), zonedDateTimeEpochMicrosecondsDesc); JSGetterSetter zonedDateTimeEpochNanosecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyepochNanoseconds(), builtinTemporalZonedDateTimeEpochNanoSeconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochNanoseconds(), builtinTemporalZonedDateTimeEpochNanoSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeEpochNanosecondsDesc(zonedDateTimeEpochNanosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyepochNanoseconds()), zonedDateTimeEpochNanosecondsDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochNanoseconds()), zonedDateTimeEpochNanosecondsDesc); JSGetterSetter zonedDateTimeDayOfWeekGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfWeek(), builtinTemporalZonedDateTimeDayOfWeek, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalZonedDateTimeDayOfWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDayOfWeekDesc(zonedDateTimeDayOfWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfWeek()), zonedDateTimeDayOfWeekDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), zonedDateTimeDayOfWeekDesc); JSGetterSetter zonedDateTimeDayOfYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfYear(), builtinTemporalZonedDateTimeDayOfYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalZonedDateTimeDayOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDayOfYearDesc(zonedDateTimeDayOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfYear()), zonedDateTimeDayOfYearDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), zonedDateTimeDayOfYearDesc); JSGetterSetter zonedDateTimeWeekOfYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyweekOfYear(), builtinTemporalZonedDateTimeWeekOfYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalZonedDateTimeWeekOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeWeekOfYearDesc(zonedDateTimeWeekOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyweekOfYear()), zonedDateTimeWeekOfYearDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), zonedDateTimeWeekOfYearDesc); JSGetterSetter zonedDateTimeHoursInDayGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyhoursInDay(), builtinTemporalZonedDateTimeHoursInDay, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyHoursInDay(), builtinTemporalZonedDateTimeHoursInDay, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeHoursInDayDesc(zonedDateTimeHoursInDayGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyhoursInDay()), zonedDateTimeHoursInDayDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHoursInDay()), zonedDateTimeHoursInDayDesc); JSGetterSetter zonedDateTimeDaysInWeekGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInWeek(), builtinTemporalZonedDateTimeDaysInWeek, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalZonedDateTimeDaysInWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDaysInWeekDesc(zonedDateTimeDaysInWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInWeek()), zonedDateTimeDaysInWeekDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), zonedDateTimeDaysInWeekDesc); JSGetterSetter zonedDateTimeDaysInMonthGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInMonth(), builtinTemporalZonedDateTimeDaysInMonth, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalZonedDateTimeDaysInMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDaysInMonthDesc(zonedDateTimeDaysInMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInMonth()), zonedDateTimeDaysInMonthDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), zonedDateTimeDaysInMonthDesc); JSGetterSetter zonedDateTimeDaysInYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInYear(), builtinTemporalZonedDateTimeDaysInYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalZonedDateTimeDaysInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDaysInYearDesc(zonedDateTimeDaysInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInYear()), zonedDateTimeDaysInYearDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), zonedDateTimeDaysInYearDesc); JSGetterSetter zonedDateTimeMonthsInYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthsInYear(), builtinTemporalZonedDateTimeMonthsInYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalZonedDateTimeMonthsInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMonthsInYearDesc(zonedDateTimeMonthsInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthsInYear()), zonedDateTimeMonthsInYearDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), zonedDateTimeMonthsInYearDesc); JSGetterSetter zonedDateTimeInLeapYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyinLeapYear(), builtinTemporalZonedDateTimeInLeapYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalZonedDateTimeInLeapYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeInLeapYearDesc(zonedDateTimeInLeapYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyinLeapYear()), zonedDateTimeInLeapYearDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), zonedDateTimeInLeapYearDesc); JSGetterSetter zonedDateTimeOffsetNanosecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyoffsetNanoseconds(), builtinTemporalZonedDateTimeOffsetNanoseconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyOffsetNanoseconds(), builtinTemporalZonedDateTimeOffsetNanoseconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeOffsetNanosecondsDesc(zonedDateTimeOffsetNanosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyoffsetNanoseconds()), zonedDateTimeOffsetNanosecondsDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyOffsetNanoseconds()), zonedDateTimeOffsetNanosecondsDesc); JSGetterSetter zonedDateTimeOffsetGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyoffset(), builtinTemporalZonedDateTimeOffset, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyOffset(), builtinTemporalZonedDateTimeOffset, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeOffsetDesc(zonedDateTimeOffsetGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyoffset()), zonedDateTimeOffsetDesc); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyOffset()), zonedDateTimeOffsetDesc); temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalZonedDateTimePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazysubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazysubtract(), builtinTemporalZonedDateTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalZonedDateTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalZonedDateTime->setFunctionPrototype(state, temporalZonedDateTimePrototype); temporalZonedDateTime->directDefineOwnProperty(state, ObjectPropertyName(strings->from), @@ -2087,64 +2087,64 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalDurationPrototype->setGlobalIntrinsicObject(state, true); JSGetterSetter durationYearsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyyears(), builtinTemporalDurationPrototypeYears, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYears(), builtinTemporalDurationPrototypeYears, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationYearsDesc(durationYearsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyyears()), durationYearsDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYears()), durationYearsDesc); JSGetterSetter durationMonthsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonths(), builtinTemporalDurationPrototypeMonths, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonths(), builtinTemporalDurationPrototypeMonths, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationMonthsDesc(durationMonthsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonths()), durationMonthsDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonths()), durationMonthsDesc); JSGetterSetter durationWeeksGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyweeks(), builtinTemporalDurationPrototypeWeeks, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeeks(), builtinTemporalDurationPrototypeWeeks, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationWeeksDesc(durationWeeksGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyweeks()), durationWeeksDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeeks()), durationWeeksDesc); JSGetterSetter durationDaysGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydays(), builtinTemporalDurationPrototypeDays, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDays(), builtinTemporalDurationPrototypeDays, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationDaysDesc(durationDaysGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydays()), durationDaysDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDays()), durationDaysDesc); JSGetterSetter durationYHoursGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyhours(), builtinTemporalDurationPrototypeHours, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyHours(), builtinTemporalDurationPrototypeHours, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationHoursDesc(durationYHoursGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyhours()), durationHoursDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHours()), durationHoursDesc); JSGetterSetter durationMinutesGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyminutes(), builtinTemporalDurationPrototypeMinutes, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMinutes(), builtinTemporalDurationPrototypeMinutes, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationMinutesDesc(durationMinutesGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyminutes()), durationMinutesDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMinutes()), durationMinutesDesc); JSGetterSetter durationSecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyseconds(), builtinTemporalDurationPrototypeSeconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySeconds(), builtinTemporalDurationPrototypeSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationSecondsDesc(durationSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyseconds()), durationSecondsDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySeconds()), durationSecondsDesc); JSGetterSetter durationMilliSecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymilliseconds(), builtinTemporalDurationPrototypeMilliSeconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMilliseconds(), builtinTemporalDurationPrototypeMilliSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationMilliSecondsDesc(durationMilliSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymilliseconds()), durationMilliSecondsDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMilliseconds()), durationMilliSecondsDesc); JSGetterSetter durationMicroSecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymicroseconds(), builtinTemporalDurationPrototypeMicroSeconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMicroseconds(), builtinTemporalDurationPrototypeMicroSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationMicroSecondsDesc(durationMicroSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymicroseconds()), durationMicroSecondsDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMicroseconds()), durationMicroSecondsDesc); JSGetterSetter durationNanoSecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazynanoseconds(), builtinTemporalDurationPrototypeNanoSeconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyNanoseconds(), builtinTemporalDurationPrototypeNanoSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationNanoSecondsDesc(durationNanoSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazynanoseconds()), durationNanoSecondsDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNanoseconds()), durationNanoSecondsDesc); JSGetterSetter durationSignGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->sign, builtinTemporalDurationPrototypeSign, 0, NativeFunctionInfo::Strict)), @@ -2153,22 +2153,22 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->sign), durationSignDesc); JSGetterSetter durationBlankGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyblank(), builtinTemporalDurationPrototypeBlank, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyBlank(), builtinTemporalDurationPrototypeBlank, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationBlankDesc(durationBlankGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyblank()), durationBlankDesc); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyBlank()), durationBlankDesc); temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalDurationPrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazysubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazysubtract(), builtinTemporalDurationPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalDurationPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->abs), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->abs, builtinTemporalDurationPrototypeAbs, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazynegated()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazynegated(), builtinTemporalDurationPrototypeNegated, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNegated()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyNegated(), builtinTemporalDurationPrototypeNegated, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalDuration->setFunctionPrototype(state, temporalDurationPrototype); @@ -2206,10 +2206,10 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), yearMonthMonthDesc); JSGetterSetter yearMonthMonthCodeGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthCode(), builtinTemporalPlainYearMonthMonthCode, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalPlainYearMonthMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthMonthCodeDesc(yearMonthMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthCode()), yearMonthMonthCodeDesc); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), yearMonthMonthCodeDesc); JSGetterSetter yearMonthDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalPlainYearMonthDay, 0, NativeFunctionInfo::Strict)), @@ -2218,63 +2218,63 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), yearMonthDayDesc); JSGetterSetter yearMonthDayOfWeekGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfWeek(), builtinTemporalPlainYearMonthDayOfWeek, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalPlainYearMonthDayOfWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDayOfWeekDesc(yearMonthDayOfWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfWeek()), yearMonthDayOfWeekDesc); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), yearMonthDayOfWeekDesc); JSGetterSetter yearMonthDayOfYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfYear(), builtinTemporalPlainYearMonthDayOfYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalPlainYearMonthDayOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDayOfYearDesc(yearMonthDayOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfYear()), yearMonthDayOfYearDesc); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), yearMonthDayOfYearDesc); JSGetterSetter yearMonthWeekOfYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyweekOfYear(), builtinTemporalPlainYearMonthWeekOfYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalPlainYearMonthWeekOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthWeekOfYearDesc(yearMonthWeekOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyweekOfYear()), yearMonthWeekOfYearDesc); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), yearMonthWeekOfYearDesc); JSGetterSetter yearMonthDaysInWeekGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInWeek(), builtinTemporalPlainYearMonthDaysInWeek, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalPlainYearMonthDaysInWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDaysInWeekDesc(yearMonthDaysInWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInWeek()), yearMonthDaysInWeekDesc); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), yearMonthDaysInWeekDesc); JSGetterSetter yearMonthDaysInMonthGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInMonth(), builtinTemporalPlainYearMonthDaysInMonth, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalPlainYearMonthDaysInMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDaysInMonthDesc(yearMonthDaysInMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInMonth()), yearMonthDaysInMonthDesc); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), yearMonthDaysInMonthDesc); JSGetterSetter yearMonthDaysInYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInYear(), builtinTemporalPlainYearMonthDaysInYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalPlainYearMonthDaysInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDaysInYearDesc(yearMonthDaysInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInYear()), yearMonthDaysInYearDesc); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), yearMonthDaysInYearDesc); JSGetterSetter yearMonthMonthsInYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthsInYear(), builtinTemporalPlainYearMonthMonthsInYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalPlainYearMonthMonthsInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthMonthsInYearDesc(yearMonthMonthsInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthsInYear()), yearMonthMonthsInYearDesc); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), yearMonthMonthsInYearDesc); JSGetterSetter yearMonthInLeapYearGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyinLeapYear(), builtinTemporalPlainYearMonthInLeapYear, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalPlainYearMonthInLeapYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthInLeapYearDesc(yearMonthInLeapYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyinLeapYear()), yearMonthInLeapYearDesc); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), yearMonthInLeapYearDesc); temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainYearMonth, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainYearMonthPrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazysubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazysubtract(), builtinTemporalPlainYearMonthPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainYearMonthPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyequals()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyequals(), builtinTemporalPlainYearMonthPrototypeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEquals()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEquals(), builtinTemporalPlainYearMonthPrototypeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalPlainYearMonth->setFunctionPrototype(state, temporalPlainYearMonthPrototype); @@ -2284,17 +2284,17 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalInstantFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyfromEpochSeconds()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyfromEpochSeconds(), builtinTemporalInstantFromEpochSeconds, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyFromEpochSeconds()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyFromEpochSeconds(), builtinTemporalInstantFromEpochSeconds, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyfromEpochMilliseconds()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyfromEpochMilliseconds(), builtinTemporalInstantFromEpochMilliSeconds, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyFromEpochMilliseconds()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyFromEpochMilliseconds(), builtinTemporalInstantFromEpochMilliSeconds, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyfromEpochMicroseconds()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyfromEpochMicroseconds(), builtinTemporalInstantFromEpochMicroSeconds, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyFromEpochMicroseconds()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyFromEpochMicroseconds(), builtinTemporalInstantFromEpochMicroSeconds, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyfromEpochNanoseconds()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyfromEpochNanoseconds(), builtinTemporalInstantFromEpochNanoSeconds, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyFromEpochNanoseconds()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyFromEpochNanoseconds(), builtinTemporalInstantFromEpochNanoSeconds, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->compare), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->compare, builtinTemporalInstantCompare, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -2305,37 +2305,37 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalInstant, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); JSGetterSetter instantSecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyepochSeconds(), builtinTemporalInstantPrototypeEpochSeconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochSeconds(), builtinTemporalInstantPrototypeEpochSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor instantSecondsDesc(instantSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyepochSeconds()), instantSecondsDesc); + temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochSeconds()), instantSecondsDesc); JSGetterSetter instantMillisecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyepochMilliseconds(), builtinTemporalInstantPrototypeEpochMilliseconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochMilliseconds(), builtinTemporalInstantPrototypeEpochMilliseconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor instantMillisecondsDesc(instantMillisecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyepochMilliseconds()), instantMillisecondsDesc); + temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMilliseconds()), instantMillisecondsDesc); JSGetterSetter instantMicrosecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyepochMicroseconds(), builtinTemporalInstantPrototypeEpochMicroseconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochMicroseconds(), builtinTemporalInstantPrototypeEpochMicroseconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor instantMicrosecondsDesc(instantMicrosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyepochMicroseconds()), instantMicrosecondsDesc); + temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMicroseconds()), instantMicrosecondsDesc); JSGetterSetter instantNanosecondsGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyepochNanoseconds(), builtinTemporalInstantPrototypeEpochNanoseconds, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochNanoseconds(), builtinTemporalInstantPrototypeEpochNanoseconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor instantNanosecondsDesc(instantNanosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyepochNanoseconds()), instantNanosecondsDesc); + temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochNanoseconds()), instantNanosecondsDesc); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyequals()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyequals(), builtinTemporalInstantPrototypeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEquals()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEquals(), builtinTemporalInstantPrototypeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalInstantPrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazysubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazysubtract(), builtinTemporalInstantPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalInstantPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalInstant->setFunctionPrototype(state, temporalInstantPrototype); @@ -2354,10 +2354,10 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), monthDayCalendarDesc); JSGetterSetter monthDayMonthCodeGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthCode(), builtinTemporalPlainMonthDayPrototypeMonthCode, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalPlainMonthDayPrototypeMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor monthDayMonthCodeDesc(monthDayMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthCode()), monthDayMonthCodeDesc); + temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), monthDayMonthCodeDesc); JSGetterSetter monthDayDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalPlainMonthDayPrototypeDay, 0, NativeFunctionInfo::Strict)), @@ -2380,28 +2380,28 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalTimeZone, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); JSGetterSetter timeZoneIDGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyid(), builtinTemporalTimeZonePrototypeId, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyId(), builtinTemporalTimeZonePrototypeId, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeZoneIDDesc(timeZoneIDGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyid()), timeZoneIDDesc); + temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyId()), timeZoneIDDesc); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazygetOffsetNanosecondsFor()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazygetOffsetNanosecondsFor(), builtinTemporalTimeZonePrototypeGetOffsetNanosecondsFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetOffsetNanosecondsFor()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetOffsetNanosecondsFor(), builtinTemporalTimeZonePrototypeGetOffsetNanosecondsFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazygetOffsetStringFor()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazygetOffsetStringFor(), builtinTemporalTimeZonePrototypeGetOffsetStringFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetOffsetStringFor()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetOffsetStringFor(), builtinTemporalTimeZonePrototypeGetOffsetStringFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazygetPlainDateTimeFor()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazygetPlainDateTimeFor(), builtinTemporalTimeZonePrototypeGetPlainDateTimeFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetPlainDateTimeFor()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetPlainDateTimeFor(), builtinTemporalTimeZonePrototypeGetPlainDateTimeFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazygetPossibleInstantsFor()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazygetPossibleInstantsFor(), builtinTemporalTimeZonePrototypeGetPossibleInstantsFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetPossibleInstantsFor()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetPossibleInstantsFor(), builtinTemporalTimeZonePrototypeGetPossibleInstantsFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazygetNextTransition()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazygetNextTransition(), builtinTemporalTimeZonePrototypeGetNextTransition, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetNextTransition()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetNextTransition(), builtinTemporalTimeZonePrototypeGetNextTransition, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazygetPreviousTransition()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazygetPreviousTransition(), builtinTemporalTimeZonePrototypeGetPreviousTransition, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetPreviousTransition()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetPreviousTransition(), builtinTemporalTimeZonePrototypeGetPreviousTransition, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalTimeZone->setFunctionPrototype(state, temporalTimeZonePrototype); @@ -2412,10 +2412,10 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalCalendarPrototype->setGlobalIntrinsicObject(state, true); JSGetterSetter calendarIDGS( - new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyid(), builtinTemporalCalendarPrototypeId, 0, NativeFunctionInfo::Strict)), + new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyId(), builtinTemporalCalendarPrototypeId, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor calendarIDDesc(calendarIDGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyid()), calendarIDDesc); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyId()), calendarIDDesc); temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalCalendar, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -2423,28 +2423,28 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalCalendar->setFunctionPrototype(state, temporalCalendarPrototype); temporalNow->directDefineOwnProperty(state, ObjectPropertyName(state.context()->vmInstance()->globalSymbols().toStringTag), - ObjectPropertyDescriptor(strings->temporalDotNow.string(), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); + ObjectPropertyDescriptor(strings->lazyTemporalDotNow().string(), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); - temporalNow->directDefineOwnProperty(state, ObjectPropertyName(strings->lazytimeZone()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazytimeZone(), builtinTemporalNowTimeZone, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalNow->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyTimeZone()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyTimeZone(), builtinTemporalNowTimeZone, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalNow->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyplainDateISO()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyplainDateISO(), builtinTemporalNowPlainDateISO, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalNow->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyPlainDateISO()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyPlainDateISO(), builtinTemporalNowPlainDateISO, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalNow->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyplainTimeISO()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyplainTimeISO(), builtinTemporalNowPlainTimeISO, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalNow->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyPlainTimeISO()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyPlainTimeISO(), builtinTemporalNowPlainTimeISO, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalNow->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyplainDateTimeISO()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyplainDateTimeISO(), builtinTemporalNowPlainDateTimeISO, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalNow->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyPlainDateTimeISO()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyPlainDateTimeISO(), builtinTemporalNowPlainDateTimeISO, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalPlainDate->directDefineOwnProperty(state, ObjectPropertyName(state.context()->vmInstance()->globalSymbols().toStringTag), - ObjectPropertyDescriptor(strings->temporalDotPlainDate.string(), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); + ObjectPropertyDescriptor(strings->lazyTemporalDotPlainDate().string(), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); temporalCalendar->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalCalendarFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydateFromFields()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydateFromFields(), builtinTemporalCalendarPrototypeDateFromFields, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDateFromFields()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDateFromFields(), builtinTemporalCalendarPrototypeDateFromFields, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYear(), builtinTemporalCalendarPrototypeYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -2452,41 +2452,41 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonth(), builtinTemporalCalendarPrototypeMonth, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthCode()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthCode(), builtinTemporalCalendarPrototypeMonthCode, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalCalendarPrototypeMonthCode, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalCalendarPrototypeDay, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfWeek()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfWeek(), builtinTemporalCalendarPrototypeDayOfWeek, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalCalendarPrototypeDayOfWeek, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydayOfYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydayOfYear(), builtinTemporalCalendarPrototypeDayOfYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalCalendarPrototypeDayOfYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyweekOfYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyweekOfYear(), builtinTemporalCalendarPrototypeWeekOfYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalCalendarPrototypeWeekOfYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInWeek()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInWeek(), builtinTemporalCalendarPrototypeDaysInWeek, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalCalendarPrototypeDaysInWeek, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInMonth()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInMonth(), builtinTemporalCalendarPrototypeDaysInMonth, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalCalendarPrototypeDaysInMonth, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazydaysInYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazydaysInYear(), builtinTemporalCalendarPrototypeDaysInYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalCalendarPrototypeDaysInYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymonthsInYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymonthsInYear(), builtinTemporalCalendarPrototypeMonthsInYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalCalendarPrototypeMonthsInYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyinLeapYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyinLeapYear(), builtinTemporalCalendarInLeapYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalCalendarInLeapYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazymergeFields()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazymergeFields(), builtinTemporalCalendarPrototypeMergeFields, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMergeFields()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMergeFields(), builtinTemporalCalendarPrototypeMergeFields, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyfields()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyfields(), builtinTemporalCalendarFields, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyFields()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyFields(), builtinTemporalCalendarFields, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->toString), diff --git a/src/runtime/StaticStrings.cpp b/src/runtime/StaticStrings.cpp index 686cc9ccc..4315954c9 100644 --- a/src/runtime/StaticStrings.cpp +++ b/src/runtime/StaticStrings.cpp @@ -138,8 +138,6 @@ void StaticStrings::initStaticStrings() INIT_STATIC_STRING(symbolReplace, "[Symbol.replace]"); INIT_STATIC_STRING(symbolSearch, "[Symbol.search]"); INIT_STATIC_STRING(symbolSplit, "[Symbol.split]"); - INIT_STATIC_STRING(temporalDotNow, "Temporal.Now"); - INIT_STATIC_STRING(temporalDotPlainDate, "Temporal.PlainDate"); #if defined(ENABLE_WASM) INIT_STATIC_STRING(getExports, "get exports"); diff --git a/src/runtime/StaticStrings.h b/src/runtime/StaticStrings.h index bae8d48ef..cd9779079 100644 --- a/src/runtime/StaticStrings.h +++ b/src/runtime/StaticStrings.h @@ -815,98 +815,102 @@ namespace Escargot { F(Weekday, "weekday") \ F(WeekInfo, "weekInfo") \ F(Year, "year") +#else +#define FOR_EACH_LAZY_INTL_STATIC_STRING(F) +#endif +#if defined(ENABLE_TEMPORAL) #define FOR_EACH_LAZY_TEMPORAL_STATIC_STRING(F) \ + F(Blank, "blank") \ + F(Compatible, "compatible") \ F(Calendar, "Calendar") \ + F(DateAdd, "dateAdd") \ + F(DateFromFields, "dateFromFields") \ F(DateTime, "DateTime") \ + F(DateUntil, "dateUntil") \ + F(DayOfWeek, "dayOfWeek") \ + F(DayOfYear, "dayOfYear") \ + F(Days, "days") \ + F(DaysInMonth, "daysInMonth") \ + F(DaysInWeek, "daysInWeek") \ + F(DaysInYear, "daysInYear") \ + F(Disambiguation, "disambiguation") \ F(Duration, "Duration") \ + F(Earlier, "earlier") \ + F(EpochMicroseconds, "epochMicroseconds") \ + F(EpochMilliseconds, "epochMilliseconds") \ + F(EpochNanoseconds, "epochNanoseconds") \ + F(EpochSeconds, "epochSeconds") \ + F(Equals, "equals") \ + F(Fields, "fields") \ + F(FromEpochMicroseconds, "fromEpochMicroseconds") \ + F(FromEpochMilliseconds, "fromEpochMilliseconds") \ + F(FromEpochNanoseconds, "fromEpochNanoseconds") \ + F(FromEpochSeconds, "fromEpochSeconds") \ + F(GetISOFields, "getISOFields") \ + F(GetNextTransition, "getNextTransition") \ + F(GetOffsetNanosecondsFor, "getOffsetNanosecondsFor") \ + F(GetOffsetStringFor, "getOffsetStringFor") \ + F(GetPlainDateTimeFor, "getPlainDateTimeFor") \ + F(GetPossibleInstantsFor, "getPossibleInstantsFor") \ + F(GetPreviousTransition, "getPreviousTransition") \ + F(Hours, "hours") \ + F(HoursInDay, "hoursInDay") \ F(ISO8601, "iso8601") \ + F(Id, "id") \ + F(Ignore, "ignore") \ + F(InLeapYear, "inLeapYear") \ + F(IsoHour, "isoHour") \ + F(IsoMicrosecond, "isoMicrosecond") \ + F(IsoMillisecond, "isoMillisecond") \ + F(IsoMinute, "isoMinute") \ + F(IsoNanosecond, "isoNanosecond") \ + F(IsoSecond, "isoSecond") \ F(Instant, "Instant") \ + F(LargestUnit, "largestUnit") \ + F(Later, "later") \ + F(MergeFields, "mergeFields") \ + F(Microsecond, "microsecond") \ + F(Microseconds, "microseconds") \ + F(Millisecond, "millisecond") \ + F(Milliseconds, "milliseconds") \ + F(Minutes, "minutes") \ + F(MonthCode, "monthCode") \ + F(MonthDayFromFields, "monthDayFromFields") \ + F(Months, "months") \ + F(MonthsInYear, "monthsInYear") \ + F(Nanosecond, "nanosecond") \ + F(Nanoseconds, "nanoseconds") \ + F(Negated, "negated") \ F(Now, "Now") \ + F(Offset, "offset") \ + F(OffsetNanoseconds, "offsetNanoseconds") \ + F(Overflow, "overflow") \ F(PlainMonthDay, "PlainMonthDay") \ F(PlainDate, "PlainDate") \ + F(PlainDateISO, "plainDateISO") \ F(PlainDateTime, "PlainDateTime") \ F(PlainTime, "PlainTime") \ + F(PlainTimeISO, "plainTimeISO") \ F(PlainYearMonth, "PlainYearMonth") \ + F(PlainDateTimeISO, "plainDateTimeISO") \ + F(Prefer, "prefer") \ + F(RelativeTo, "relativeTo") \ + F(Seconds, "seconds") \ + F(Subtract, "subtract") \ F(Temporal, "Temporal") \ + F(TemporalDotNow, "Temporal.Now") \ + F(TemporalDotPlainDate, "Temporal.PlainDate") \ F(TemporalTimeZone, "TimeZone") \ + F(ToPlainDateTime, "toPlainDateTime") \ + F(Use, "use") \ + F(WeekOfYear, "weekOfYear") \ + F(Weeks, "weeks") \ + F(YearMonthFromFields, "yearMonthFromFields") \ + F(Years, "years") \ F(ZonedDateTime, "ZonedDateTime") \ - F(blank, "blank") \ - F(compatible, "compatible") \ - F(dateAdd, "dateAdd") \ - F(dateFromFields, "dateFromFields") \ - F(dateUntil, "dateUntil") \ - F(days, "days") \ - F(daysInMonth, "daysInMonth") \ - F(daysInYear, "daysInYear") \ - F(daysInWeek, "daysInWeek") \ - F(dayOfWeek, "dayOfWeek") \ - F(dayOfYear, "dayOfYear") \ - F(disambiguation, "disambiguation") \ - F(earlier, "earlier") \ - F(epochMicroseconds, "epochMicroseconds") \ - F(epochMilliseconds, "epochMilliseconds") \ - F(epochNanoseconds, "epochNanoseconds") \ - F(epochSeconds, "epochSeconds") \ - F(equals, "equals") \ - F(fields, "fields") \ - F(fromEpochMicroseconds, "fromEpochMicroseconds") \ - F(fromEpochMilliseconds, "fromEpochMilliseconds") \ - F(fromEpochNanoseconds, "fromEpochNanoseconds") \ - F(fromEpochSeconds, "fromEpochSeconds") \ - F(getISOFields, "getISOFields") \ - F(getNextTransition, "getNextTransition") \ - F(getPlainDateTimeFor, "getPlainDateTimeFor") \ - F(getPossibleInstantsFor, "getPossibleInstantsFor") \ - F(getPreviousTransition, "getPreviousTransition") \ - F(getOffsetNanosecondsFor, "getOffsetNanosecondsFor") \ - F(getOffsetStringFor, "getOffsetStringFor") \ - F(hours, "hours") \ - F(hoursInDay, "hoursInDay") \ - F(id, "id") \ - F(ignore, "ignore") \ - F(inLeapYear, "inLeapYear") \ - F(isoHour, "isoHour") \ - F(isoMicrosecond, "isoMicrosecond") \ - F(isoMillisecond, "isoMillisecond") \ - F(isoMinute, "isoMinute") \ - F(isoNanosecond, "isoNanosecond") \ - F(isoSecond, "isoSecond") \ - F(largestUnit, "largestUnit") \ - F(later, "later") \ - F(mergeFields, "mergeFields") \ - F(microsecond, "microsecond") \ - F(microseconds, "microseconds") \ - F(millisecond, "millisecond") \ - F(milliseconds, "milliseconds") \ - F(minutes, "minutes") \ - F(months, "months") \ - F(monthCode, "monthCode") \ - F(monthDayFromFields, "monthDayFromFields") \ - F(monthsInYear, "monthsInYear") \ - F(nanosecond, "nanosecond") \ - F(nanoseconds, "nanoseconds") \ - F(negated, "negated") \ - F(offset, "offset") \ - F(offsetNanoseconds, "offsetNanoseconds") \ - F(overflow, "overflow") \ - F(plainDateISO, "plainDateISO") \ - F(plainDateTimeISO, "plainDateTimeISO") \ - F(plainTimeISO, "plainTimeISO") \ - F(prefer, "prefer") \ - F(relativeTo, "relativeTo") \ - F(seconds, "seconds") \ - F(subtract, "subtract") \ - F(timeZone, "timeZone") \ - F(toPlainDateTime, "toPlainDateTime") \ - F(use, "use") \ - F(weekOfYear, "weekOfYear") \ - F(yearMonthFromFields, "yearMonthFromFields") \ - F(years, "years") \ - F(weeks, "weeks") \ - F(zonedDateTimeISO, "zonedDateTimeISO") + F(ZonedDateTimeISO, "zonedDateTimeISO") #else -#define FOR_EACH_LAZY_INTL_STATIC_STRING(F) #define FOR_EACH_LAZY_TEMPORAL_STATIC_STRING(F) #endif @@ -1049,8 +1053,6 @@ class StaticStrings { AtomicString symbolReplace; AtomicString symbolSearch; AtomicString symbolSplit; - AtomicString temporalDotNow; - AtomicString temporalDotPlainDate; #if defined(ENABLE_WASM) AtomicString getExports; diff --git a/src/runtime/Temporal.h b/src/runtime/Temporal.h index cbd189e31..c1080107f 100644 --- a/src/runtime/Temporal.h +++ b/src/runtime/Temporal.h @@ -128,7 +128,7 @@ class Temporal : public DerivedObject { } auto options = normalizedOptions.toObject(state); Value matcherValues[2] = { state.context()->staticStrings().lazyConstrain().string(), state.context()->staticStrings().reject.string() }; - return Intl::getOption(state, options, state.context()->staticStrings().lazyoverflow().string(), Intl::StringValue, matcherValues, 2, matcherValues[0]); + return Intl::getOption(state, options, state.context()->staticStrings().lazyOverflow().string(), Intl::StringValue, matcherValues, 2, matcherValues[0]); } static Value toTemporalDisambiguation(ExecutionState& state, const Value& options) @@ -137,8 +137,8 @@ class Temporal : public DerivedObject { return state.context()->staticStrings().lazyConstrain().string(); } - Value matcherValues[4] = { state.context()->staticStrings().lazyConstrain().string(), state.context()->staticStrings().lazyearlier().string(), state.context()->staticStrings().lazylater().string(), state.context()->staticStrings().reject.string() }; - return Intl::getOption(state, options.asObject(), state.context()->staticStrings().lazydisambiguation().string(), Intl::StringValue, matcherValues, 4, matcherValues[0]); + Value matcherValues[4] = { state.context()->staticStrings().lazyConstrain().string(), state.context()->staticStrings().lazyEarlier().string(), state.context()->staticStrings().lazyLater().string(), state.context()->staticStrings().reject.string() }; + return Intl::getOption(state, options.asObject(), state.context()->staticStrings().lazyDisambiguation().string(), Intl::StringValue, matcherValues, 4, matcherValues[0]); } static Value toTemporalOffset(ExecutionState& state, const Value& options, const Value& fallback) @@ -147,8 +147,8 @@ class Temporal : public DerivedObject { return fallback; } - Value matcherValues[4] = { state.context()->staticStrings().lazyprefer().string(), state.context()->staticStrings().lazyuse().string(), state.context()->staticStrings().lazyignore().string(), state.context()->staticStrings().reject.string() }; - return Intl::getOption(state, options.asObject(), state.context()->staticStrings().lazyoffset().string(), Intl::StringValue, matcherValues, 4, fallback); + Value matcherValues[4] = { state.context()->staticStrings().lazyPrefer().string(), state.context()->staticStrings().lazyUse().string(), state.context()->staticStrings().lazyIgnore().string(), state.context()->staticStrings().reject.string() }; + return Intl::getOption(state, options.asObject(), state.context()->staticStrings().lazyOffset().string(), Intl::StringValue, matcherValues, 4, fallback); } static Value prepareTemporalFields(ExecutionState& state, const Value& fields, const ValueVector& fieldNames, const ValueVector& requiredFields) @@ -197,7 +197,7 @@ class Temporal : public DerivedObject { ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("Object has calendar property")); } - if (!object.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().lazytimeZone().string())).value(state, object).isUndefined()) { + if (!object.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().lazyTimeZone().string())).value(state, object).isUndefined()) { ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("Object has timezone property")); } } diff --git a/src/runtime/TemporalObject.cpp b/src/runtime/TemporalObject.cpp index e2f18baf1..67b34460e 100644 --- a/src/runtime/TemporalObject.cpp +++ b/src/runtime/TemporalObject.cpp @@ -87,11 +87,11 @@ String* TemporalObject::dateTimeUnitString(ExecutionState& state, DateTimeUnits case SECOND_UNIT: return strings.lazySecond().string(); case MILLISECOND_UNIT: - return strings.lazymillisecond().string(); + return strings.lazyMillisecond().string(); case MICROSECOND_UNIT: - return strings.lazymicrosecond().string(); + return strings.lazyMicrosecond().string(); case NANOSECOND_UNIT: - return strings.lazynanosecond().string(); + return strings.lazyNanosecond().string(); default: return String::emptyString; } @@ -683,7 +683,7 @@ TemporalPlainTimeObject::TemporalPlainTimeObject(ExecutionState& state, Object* Value TemporalObject::toRelativeTemporalObject(ExecutionState& state, Object* options) { - auto value = options->get(state, ObjectPropertyName(state.context()->staticStrings().lazyrelativeTo())).value(state, options); + auto value = options->get(state, ObjectPropertyName(state.context()->staticStrings().lazyRelativeTo())).value(state, options); if (value.isUndefined()) { return value; @@ -713,20 +713,20 @@ Value TemporalObject::toRelativeTemporalObject(ExecutionState& state, Object* op calendar = TemporalCalendarObject::getTemporalCalendarWithISODefault(state, value); ValueVector values = { Value(state.context()->staticStrings().lazyDay().string()), Value(state.context()->staticStrings().lazyHour().string()), - Value(state.context()->staticStrings().lazymicrosecond().string()), - Value(state.context()->staticStrings().lazymillisecond().string()), + Value(state.context()->staticStrings().lazyMicrosecond().string()), + Value(state.context()->staticStrings().lazyMillisecond().string()), Value(state.context()->staticStrings().lazyMinute().string()), Value(state.context()->staticStrings().lazyMonth().string()), - Value(state.context()->staticStrings().lazymonthCode().string()), - Value(state.context()->staticStrings().lazynanosecond().string()), + Value(state.context()->staticStrings().lazyMonthCode().string()), + Value(state.context()->staticStrings().lazyNanosecond().string()), Value(state.context()->staticStrings().lazySecond().string()), Value(state.context()->staticStrings().lazyYear().string()) }; ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, calendar, values); Value fields = Temporal::prepareTemporalFields(state, value, fieldNames, ValueVector()); result = TemporalPlainDateTimeObject::interpretTemporalDateTimeFields(state, calendar, fields, options); - offsetString = valueObject->get(state, ObjectPropertyName(state.context()->staticStrings().lazyoffset())).value(state, value); - timeZone = valueObject->get(state, ObjectPropertyName(state.context()->staticStrings().lazyoffset())).value(state, value); + offsetString = valueObject->get(state, ObjectPropertyName(state.context()->staticStrings().lazyOffset())).value(state, value); + timeZone = valueObject->get(state, ObjectPropertyName(state.context()->staticStrings().lazyOffset())).value(state, value); if (!timeZone.isUndefined()) { timeZone = TemporalTimeZoneObject::toTemporalTimeZone(state, timeZone); @@ -775,7 +775,7 @@ Value TemporalObject::toRelativeTemporalObject(ExecutionState& state, Object* op offsetNanoseconds = TemporalInstantObject::offsetStringToNanoseconds(state, offsetString.asString()); } - auto epochNanoseconds = TemporalZonedDateTimeObject::interpretISODateTimeOffset(state, result, offsetBehaviour, offsetNanoseconds, timeZone, Value(state.context()->staticStrings().lazycompatible().string()), Value(state.context()->staticStrings().reject.string()), matchBehaviour); + auto epochNanoseconds = TemporalZonedDateTimeObject::interpretISODateTimeOffset(state, result, offsetBehaviour, offsetNanoseconds, timeZone, Value(state.context()->staticStrings().lazyCompatible().string()), Value(state.context()->staticStrings().reject.string()), matchBehaviour); return TemporalZonedDateTimeObject::createTemporalZonedDateTime(state, *epochNanoseconds.asBigInt(), timeZone.asObject()->asTemporalTimeZoneObject(), calendar.asObject()->asTemporalCalendarObject()); } @@ -791,7 +791,7 @@ Object* TemporalObject::mergeLargestUnitOption(ExecutionState& state, const Valu merged->defineOwnPropertyThrowsException(state, ObjectPropertyName(state, nextKey.toPropertyKey(state).asString()), ObjectPropertyDescriptor(propValue)); } - merged->defineOwnPropertyThrowsException(state, ObjectPropertyName(state, state.context()->staticStrings().lazylargestUnit().string()), ObjectPropertyDescriptor(dateTimeUnitString(state, largestUnit))); + merged->defineOwnPropertyThrowsException(state, ObjectPropertyName(state, state.context()->staticStrings().lazyLargestUnit().string()), ObjectPropertyDescriptor(dateTimeUnitString(state, largestUnit))); return merged; } @@ -976,10 +976,10 @@ std::map TemporalPlainTimeObject::toTemporal TemporalObject::DateTimeUnits temporalTimeLikeProp[6] = { TemporalObject::HOUR_UNIT, TemporalObject::MICROSECOND_UNIT, TemporalObject::MILLISECOND_UNIT, TemporalObject::MINUTE_UNIT, TemporalObject::NANOSECOND_UNIT, TemporalObject::SECOND_UNIT }; ValueVector values = { Value(state.context()->staticStrings().lazyHour().string()), - Value(state.context()->staticStrings().lazymicrosecond().string()), - Value(state.context()->staticStrings().lazymillisecond().string()), + Value(state.context()->staticStrings().lazyMicrosecond().string()), + Value(state.context()->staticStrings().lazyMillisecond().string()), Value(state.context()->staticStrings().lazyMinute().string()), - Value(state.context()->staticStrings().lazynanosecond().string()), + Value(state.context()->staticStrings().lazyNanosecond().string()), Value(state.context()->staticStrings().lazySecond().string()) }; Value partial = TemporalCalendarObject::prepareTemporalFields(state, temporalTimeLike, values, {}); @@ -1265,7 +1265,7 @@ Value TemporalCalendarObject::defaultMergeFields(ExecutionState& state, const Va auto originalKeys = Object::enumerableOwnProperties(state, fields.asObject(), EnumerableOwnPropertiesType::Key); for (auto& nextKey : originalKeys) { - if (!nextKey.asString()->equals(strings.lazyMonth().string()) || !nextKey.asString()->equals(strings.lazymonthCode().string())) { + if (!nextKey.asString()->equals(strings.lazyMonth().string()) || !nextKey.asString()->equals(strings.lazyMonthCode().string())) { Value propValue; fields.asObject()->get(state, AtomicString(state, nextKey.asString()), propValue); @@ -1280,7 +1280,7 @@ Value TemporalCalendarObject::defaultMergeFields(ExecutionState& state, const Va for (unsigned int i = 0; i < newKeys.size(); ++i) { Value nextKey = originalKeys[i]; - if (!nextKey.asString()->equals(strings.lazyMonth().string()) || !nextKey.asString()->equals(strings.lazymonthCode().string())) { + if (!nextKey.asString()->equals(strings.lazyMonth().string()) || !nextKey.asString()->equals(strings.lazyMonthCode().string())) { containsMonth = true; } @@ -1322,7 +1322,7 @@ Value TemporalCalendarObject::getTemporalCalendarWithISODefault(ExecutionState& ValueVector TemporalCalendarObject::calendarFields(ExecutionState& state, const Value& calendar, const ValueVector& fieldNames) { - Value fields = Object::getMethod(state, calendar.asObject(), ObjectPropertyName(state.context()->staticStrings().lazyfields())); + Value fields = Object::getMethod(state, calendar.asObject(), ObjectPropertyName(state.context()->staticStrings().lazyFields())); Value fieldsArray = Object::createArrayFromList(state, fieldNames); if (!fields.isUndefined()) { @@ -1355,7 +1355,7 @@ Value TemporalCalendarObject::calendarMonth(ExecutionState& state, Object* calen Value TemporalCalendarObject::calendarMonthCode(ExecutionState& state, Object* calendar, const Value& dateLike) { - return TemporalCalendarObject::getterHelper(state, calendar->get(state, state.context()->staticStrings().lazymonthCode()).value(state, calendar), calendar, const_cast(&dateLike)); + return TemporalCalendarObject::getterHelper(state, calendar->get(state, state.context()->staticStrings().lazyMonthCode()).value(state, calendar), calendar, const_cast(&dateLike)); } Value TemporalCalendarObject::calendarDay(ExecutionState& state, Object* calendar, const Value& dateLike) @@ -1365,49 +1365,49 @@ Value TemporalCalendarObject::calendarDay(ExecutionState& state, Object* calenda Value TemporalCalendarObject::calendarDayOfWeek(ExecutionState& state, Object* calendar, const Value& dateLike) { - Value dayOfWeek = calendar->get(state, state.context()->staticStrings().lazydayOfWeek()).value(state, calendar); + Value dayOfWeek = calendar->get(state, state.context()->staticStrings().lazyDayOfWeek()).value(state, calendar); return Object::call(state, dayOfWeek, calendar, 1, const_cast(&dateLike)); } Value TemporalCalendarObject::calendarDayOfYear(ExecutionState& state, Object* calendar, const Value& dateLike) { - Value dayOfYear = calendar->get(state, state.context()->staticStrings().lazydayOfYear()).value(state, calendar); + Value dayOfYear = calendar->get(state, state.context()->staticStrings().lazyDayOfYear()).value(state, calendar); return Object::call(state, dayOfYear, calendar, 1, const_cast(&dateLike)); } Value TemporalCalendarObject::calendarWeekOfYear(ExecutionState& state, Object* calendar, const Value& dateLike) { - Value weekOfYear = calendar->get(state, state.context()->staticStrings().lazyweekOfYear()).value(state, calendar); + Value weekOfYear = calendar->get(state, state.context()->staticStrings().lazyWeekOfYear()).value(state, calendar); return Object::call(state, weekOfYear, calendar, 1, const_cast(&dateLike)); } Value TemporalCalendarObject::calendarDaysInWeek(ExecutionState& state, Object* calendar, const Value& dateLike) { - Value daysInWeek = calendar->get(state, state.context()->staticStrings().lazydaysInWeek()).value(state, calendar); + Value daysInWeek = calendar->get(state, state.context()->staticStrings().lazyDaysInWeek()).value(state, calendar); return Object::call(state, daysInWeek, calendar, 1, const_cast(&dateLike)); } Value TemporalCalendarObject::calendarDaysInMonth(ExecutionState& state, Object* calendar, const Value& dateLike) { - Value daysInMonth = calendar->get(state, state.context()->staticStrings().lazydaysInMonth()).value(state, calendar); + Value daysInMonth = calendar->get(state, state.context()->staticStrings().lazyDaysInMonth()).value(state, calendar); return Object::call(state, daysInMonth, calendar, 1, const_cast(&dateLike)); } Value TemporalCalendarObject::calendarDaysInYear(ExecutionState& state, Object* calendar, const Value& dateLike) { - Value daysInYear = calendar->get(state, state.context()->staticStrings().lazydaysInYear()).value(state, calendar); + Value daysInYear = calendar->get(state, state.context()->staticStrings().lazyDaysInYear()).value(state, calendar); return Object::call(state, daysInYear, calendar, 1, const_cast(&dateLike)); } Value TemporalCalendarObject::calendarMonthsInYear(ExecutionState& state, Object* calendar, const Value& dateLike) { - Value monthsInYear = calendar->get(state, state.context()->staticStrings().lazymonthsInYear()).value(state, calendar); + Value monthsInYear = calendar->get(state, state.context()->staticStrings().lazyMonthsInYear()).value(state, calendar); return Object::call(state, monthsInYear, calendar, 1, const_cast(&dateLike)); } Value TemporalCalendarObject::calendarInLeapYear(ExecutionState& state, Object* calendar, const Value& dateLike) { - Value inLeapYear = calendar->get(state, state.context()->staticStrings().lazyinLeapYear()).value(state, calendar); + Value inLeapYear = calendar->get(state, state.context()->staticStrings().lazyInLeapYear()).value(state, calendar); return Object::call(state, inLeapYear, calendar, 1, const_cast(&dateLike)); } @@ -1415,7 +1415,7 @@ Value TemporalCalendarObject::dateFromFields(ExecutionState& state, const Value& { ASSERT(calendar.isObject()); ASSERT(fields.isObject()); - Value dateFromFields = calendar.asObject()->get(state, ObjectPropertyName(state.context()->staticStrings().lazydateFromFields())).value(state, calendar); + Value dateFromFields = calendar.asObject()->get(state, ObjectPropertyName(state.context()->staticStrings().lazyDateFromFields())).value(state, calendar); Value argv[2] = { fields, options }; return Object::call(state, dateFromFields, calendar, 2, argv); } @@ -1441,7 +1441,7 @@ Value TemporalCalendarObject::calendarDateAdd(ExecutionState& state, const Value ASSERT(options.isObject() || options.isUndefined()); if (dateAdd.isUndefined()) { - dateAdd = Object::getMethod(state, calendar, state.context()->staticStrings().lazydateAdd()); + dateAdd = Object::getMethod(state, calendar, state.context()->staticStrings().lazyDateAdd()); } Value argv[3] = { date, duration, options }; @@ -1453,7 +1453,7 @@ std::map TemporalCalendarObject::ISODateFrom ASSERT(fields.isObject()); auto overflow = Temporal::toTemporalOverflow(state, options); - ValueVector fieldNames = { Value(state.context()->staticStrings().lazyDay().string()), Value(state.context()->staticStrings().lazyMonth().string()), Value(state.context()->staticStrings().lazymonthCode().string()), Value(state.context()->staticStrings().lazyYear().string()) }; + ValueVector fieldNames = { Value(state.context()->staticStrings().lazyDay().string()), Value(state.context()->staticStrings().lazyMonth().string()), Value(state.context()->staticStrings().lazyMonthCode().string()), Value(state.context()->staticStrings().lazyYear().string()) }; ValueVector requiredFields = { Value(state.context()->staticStrings().lazyDay().string()), Value(state.context()->staticStrings().lazyYear().string()) }; fields = Temporal::prepareTemporalFields(state, fields, fieldNames, requiredFields); auto year = fields.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().lazyYear().string())).value(state, fields); @@ -1477,7 +1477,7 @@ std::map TemporalCalendarObject::ISODateFrom int TemporalCalendarObject::resolveISOMonth(ExecutionState& state, const Value& fields) { auto month = fields.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().lazyMonth().string())).value(state, fields); - auto monthCode = fields.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().lazymonthCode().string())).value(state, fields); + auto monthCode = fields.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().lazyMonthCode().string())).value(state, fields); if (monthCode.isUndefined()) { if (!month.isInt32()) { @@ -1519,7 +1519,7 @@ int TemporalCalendarObject::resolveISOMonth(ExecutionState& state, const Value& Value TemporalCalendarObject::calendarYearMonthFromFields(ExecutionState& state, const Value& calendar, const Value& fields, const Value& options) { Value argv[] = { fields, options }; - return Object::call(state, Object::getMethod(state, calendar, ObjectPropertyName(state.context()->staticStrings().lazyyearMonthFromFields())), calendar, 2, argv); + return Object::call(state, Object::getMethod(state, calendar, ObjectPropertyName(state.context()->staticStrings().lazyYearMonthFromFields())), calendar, 2, argv); } bool TemporalCalendarObject::calendarEquals(const TemporalCalendarObject& firstCalendar, const TemporalCalendarObject& secondCalendar) @@ -1541,7 +1541,7 @@ bool TemporalCalendarObject::operator!=(const TemporalCalendarObject& rhs) const Value TemporalCalendarObject::calendarMonthDayFromFields(ExecutionState& state, const Value& calendar, const Value& fields, const Value& options) { Value argv[] = { fields, options }; - return Object::call(state, Object::getMethod(state, calendar, ObjectPropertyName(state.context()->staticStrings().lazymonthDayFromFields())), calendar, 2, argv); + return Object::call(state, Object::getMethod(state, calendar, ObjectPropertyName(state.context()->staticStrings().lazyMonthDayFromFields())), calendar, 2, argv); } Value TemporalCalendarObject::calendarDateUntil(ExecutionState& state, const Value& calendar, const Value& first, const Value& second, const Value& options, Value dateUntil) @@ -1549,7 +1549,7 @@ Value TemporalCalendarObject::calendarDateUntil(ExecutionState& state, const Val ASSERT(calendar.isObject()); if (dateUntil.isUndefined()) { - dateUntil = Object::getMethod(state, calendar, ObjectPropertyName(state, state.context()->staticStrings().lazydateUntil().string())); + dateUntil = Object::getMethod(state, calendar, ObjectPropertyName(state, state.context()->staticStrings().lazyDateUntil().string())); } Value argv[] = { first, second, options }; @@ -1628,7 +1628,7 @@ Value TemporalPlainDateObject::toTemporalDate(ExecutionState& state, const Value ValueVector requiredFields{ Value(state.context()->staticStrings().lazyDay().string()), Value(state.context()->staticStrings().lazyMonth().string()), - Value(state.context()->staticStrings().lazymonthCode().string()), + Value(state.context()->staticStrings().lazyMonthCode().string()), Value(state.context()->staticStrings().lazyYear().string()) }; ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, calendar, ValueVector()); @@ -1814,12 +1814,12 @@ Value TemporalPlainDateTimeObject::toTemporalDateTime(ExecutionState& state, con calendar = TemporalCalendarObject::getTemporalCalendarWithISODefault(state, item); ValueVector values = { Value(state.context()->staticStrings().lazyDay().string()), Value(state.context()->staticStrings().lazyHour().string()), - Value(state.context()->staticStrings().lazymicrosecond().string()), - Value(state.context()->staticStrings().lazymillisecond().string()), + Value(state.context()->staticStrings().lazyMicrosecond().string()), + Value(state.context()->staticStrings().lazyMillisecond().string()), Value(state.context()->staticStrings().lazyMinute().string()), Value(state.context()->staticStrings().lazyMonth().string()), - Value(state.context()->staticStrings().lazymonthCode().string()), - Value(state.context()->staticStrings().lazynanosecond().string()), + Value(state.context()->staticStrings().lazyMonthCode().string()), + Value(state.context()->staticStrings().lazyNanosecond().string()), Value(state.context()->staticStrings().lazySecond().string()), Value(state.context()->staticStrings().lazyYear().string()) }; ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, calendar, values); @@ -1930,20 +1930,20 @@ Value TemporalZonedDateTimeObject::toTemporalZonedDateTime(ExecutionState& state calendar = TemporalCalendarObject::getTemporalCalendarWithISODefault(state, item).asObject()->asTemporalCalendarObject(); ValueVector values = { Value(state.context()->staticStrings().lazyDay().string()), Value(state.context()->staticStrings().lazyHour().string()), - Value(state.context()->staticStrings().lazymicrosecond().string()), - Value(state.context()->staticStrings().lazymillisecond().string()), + Value(state.context()->staticStrings().lazyMicrosecond().string()), + Value(state.context()->staticStrings().lazyMillisecond().string()), Value(state.context()->staticStrings().lazyMinute().string()), Value(state.context()->staticStrings().lazyMonth().string()), - Value(state.context()->staticStrings().lazymonthCode().string()), - Value(state.context()->staticStrings().lazynanosecond().string()), + Value(state.context()->staticStrings().lazyMonthCode().string()), + Value(state.context()->staticStrings().lazyNanosecond().string()), Value(state.context()->staticStrings().lazySecond().string()), Value(state.context()->staticStrings().lazyYear().string()) }; auto fieldNames = TemporalCalendarObject::calendarFields(state, calendar, values); - fieldNames.push_back(Value(state.context()->staticStrings().lazytimeZone().string())); - fieldNames.push_back(Value(state.context()->staticStrings().lazyoffset().string())); - auto fields = Temporal::prepareTemporalFields(state, item, fieldNames, { Value(state.context()->staticStrings().lazytimeZone().string()) }); - timeZone = TemporalTimeZoneObject::toTemporalTimeZone(state, fields.asObject()->get(state, ObjectPropertyName(state.context()->staticStrings().lazytimeZone())).value(state, fields)).asObject()->asTemporalTimeZoneObject(); - auto offsetStringValue = fields.asObject()->get(state, ObjectPropertyName(state.context()->staticStrings().lazyoffset())).value(state, fields); + fieldNames.push_back(Value(state.context()->staticStrings().lazyTimeZone().string())); + fieldNames.push_back(Value(state.context()->staticStrings().lazyOffset().string())); + auto fields = Temporal::prepareTemporalFields(state, item, fieldNames, { Value(state.context()->staticStrings().lazyTimeZone().string()) }); + timeZone = TemporalTimeZoneObject::toTemporalTimeZone(state, fields.asObject()->get(state, ObjectPropertyName(state.context()->staticStrings().lazyTimeZone())).value(state, fields)).asObject()->asTemporalTimeZoneObject(); + auto offsetStringValue = fields.asObject()->get(state, ObjectPropertyName(state.context()->staticStrings().lazyOffset())).value(state, fields); if (offsetStringValue.isUndefined()) { offsetBehaviour = TemporalZonedDateTimeObject::WALL; @@ -1997,11 +1997,11 @@ Value TemporalZonedDateTimeObject::interpretISODateTimeOffset(ExecutionState& st auto calendar = TemporalCalendarObject::getISO8601Calendar(state).asObject()->asTemporalCalendarObject(); auto dateTimeObject = TemporalPlainDateTimeObject::createTemporalDateTime(state, dateTime[TemporalObject::YEAR_UNIT], dateTime[TemporalObject::MONTH_UNIT], dateTime[TemporalObject::DAY_UNIT], dateTime[TemporalObject::HOUR_UNIT], dateTime[TemporalObject::MINUTE_UNIT], dateTime[TemporalObject::SECOND_UNIT], dateTime[TemporalObject::MILLISECOND_UNIT], dateTime[TemporalObject::MICROSECOND_UNIT], dateTime[TemporalObject::NANOSECOND_UNIT], calendar, nullptr); - if (offsetBehaviour == TemporalZonedDateTimeObject::WALL || offsetOption.toString(state)->equals(state.context()->staticStrings().lazyignore().string())) { + if (offsetBehaviour == TemporalZonedDateTimeObject::WALL || offsetOption.toString(state)->equals(state.context()->staticStrings().lazyIgnore().string())) { return TemporalTimeZoneObject::builtinTimeZoneGetInstantFor(state, timeZone, dateTimeObject, disambiguation).asObject()->asTemporalInstantObject()->getNanoseconds(); } - if (offsetBehaviour == TemporalZonedDateTimeObject::EXACT || offsetOption.toString(state)->equals(state.context()->staticStrings().lazyuse().string())) { + if (offsetBehaviour == TemporalZonedDateTimeObject::EXACT || offsetOption.toString(state)->equals(state.context()->staticStrings().lazyUse().string())) { time64_t epochNanoseconds = TemporalPlainDateTimeObject::getEpochFromISOParts(state, dateTime[TemporalObject::YEAR_UNIT], dateTime[TemporalObject::MONTH_UNIT], dateTime[TemporalObject::DAY_UNIT], dateTime[TemporalObject::HOUR_UNIT], dateTime[TemporalObject::MINUTE_UNIT], dateTime[TemporalObject::SECOND_UNIT], dateTime[TemporalObject::MILLISECOND_UNIT], dateTime[TemporalObject::MICROSECOND_UNIT], dateTime[TemporalObject::NANOSECOND_UNIT]) - offsetNanoseconds; if (!TemporalInstantObject::isValidEpochNanoseconds(Value(epochNanoseconds))) { @@ -2012,7 +2012,7 @@ Value TemporalZonedDateTimeObject::interpretISODateTimeOffset(ExecutionState& st } ASSERT(offsetBehaviour == TemporalZonedDateTimeObject::OPTION); - ASSERT(offsetOption.toString(state)->equals(state.context()->staticStrings().lazyprefer().string()) || offsetOption.toString(state)->equals(state.context()->staticStrings().reject.string())); + ASSERT(offsetOption.toString(state)->equals(state.context()->staticStrings().lazyPrefer().string()) || offsetOption.toString(state)->equals(state.context()->staticStrings().reject.string())); auto possibleInstants = TemporalTimeZoneObject::getPossibleInstantsFor(state, timeZone, dateTimeObject); for (auto& candidate : possibleInstants) { @@ -2064,7 +2064,7 @@ BigInt* TemporalZonedDateTimeObject::addZonedDateTime(ExecutionState& state, con auto dateDuration = TemporalDurationObject::createTemporalDuration(state, duration[TemporalObject::YEAR_UNIT], duration[TemporalObject::MONTH_UNIT], duration[TemporalObject::WEEK_UNIT], duration[TemporalObject::DAY_UNIT], 0, 0, 0, 0, 0, 0); auto addedDate = TemporalCalendarObject::calendarDateAdd(state, calendar, datePart, dateDuration, options).asObject()->asTemporalPlainDateObject(); auto intermediateDateTime = TemporalPlainDateTimeObject::createTemporalDateTime(state, addedDate->year(), addedDate->month(), addedDate->day(), temporalDateTime->getHour(), temporalDateTime->getMinute(), temporalDateTime->getSecond(), temporalDateTime->getMillisecond(), temporalDateTime->getMicrosecond(), temporalDateTime->getNanosecond(), calendar); - auto intermediateInstant = TemporalTimeZoneObject::builtinTimeZoneGetInstantFor(state, timeZone, intermediateDateTime, Value(state.context()->staticStrings().lazycompatible().string())); + auto intermediateInstant = TemporalTimeZoneObject::builtinTimeZoneGetInstantFor(state, timeZone, intermediateDateTime, Value(state.context()->staticStrings().lazyCompatible().string())); return TemporalInstantObject::addInstant(state, intermediateInstant.asObject()->asTemporalInstantObject()->getNanoseconds(), duration); } @@ -2346,7 +2346,7 @@ Value TemporalTimeZoneObject::builtinTimeZoneGetPlainDateTimeFor(ExecutionState& int64_t TemporalTimeZoneObject::getOffsetNanosecondsFor(ExecutionState& state, const Value& timeZone, const Value& instant) { - Value getOffsetNanosecondsFor = Object::getMethod(state, timeZone, ObjectPropertyName(state.context()->staticStrings().lazygetOffsetNanosecondsFor())); + Value getOffsetNanosecondsFor = Object::getMethod(state, timeZone, ObjectPropertyName(state.context()->staticStrings().lazyGetOffsetNanosecondsFor())); Value offsetNanoseconds = Object::call(state, getOffsetNanosecondsFor, timeZone, 1, const_cast(&instant)); if (!offsetNanoseconds.isNumber()) { @@ -2655,7 +2655,7 @@ ValueVector TemporalTimeZoneObject::getPossibleInstantsFor(ExecutionState& state { ASSERT(dateTime.asObject()->isTemporalPlainDateTimeObject()); Value argument[1] = { dateTime }; - auto possibleInstants = Object::call(state, timeZone.asObject()->get(state, state.context()->staticStrings().lazygetPossibleInstantsFor()).value(state, timeZone), timeZone, 1, argument); + auto possibleInstants = Object::call(state, timeZone.asObject()->get(state, state.context()->staticStrings().lazyGetPossibleInstantsFor()).value(state, timeZone), timeZone, 1, argument); auto iteratorRecord = IteratorObject::getIterator(state, possibleInstants, true); ValueVector list = {}; Optional next; @@ -2684,11 +2684,11 @@ Value TemporalTimeZoneObject::disambiguatePossibleInstants(ExecutionState& state } if (!possibleInstants.empty()) { - if (disambiguation.asString()->equals(state.context()->staticStrings().lazyearlier().string()) || disambiguation.asString()->equals(state.context()->staticStrings().lazycompatible().string())) { + if (disambiguation.asString()->equals(state.context()->staticStrings().lazyEarlier().string()) || disambiguation.asString()->equals(state.context()->staticStrings().lazyCompatible().string())) { return possibleInstants[0]; } - if (disambiguation.asString()->equals(state.context()->staticStrings().lazylater().string())) { + if (disambiguation.asString()->equals(state.context()->staticStrings().lazyLater().string())) { return possibleInstants[possibleInstants.size() - 1]; } @@ -2722,7 +2722,7 @@ Value TemporalTimeZoneObject::disambiguatePossibleInstants(ExecutionState& state int64_t offsetAfter = TemporalTimeZoneObject::getOffsetNanosecondsFor(state, timeZone, dayAfter); int64_t nanoseconds = offsetAfter - offsetBefore; - if (disambiguation.asString()->equals(state.context()->staticStrings().lazyearlier().string())) { + if (disambiguation.asString()->equals(state.context()->staticStrings().lazyEarlier().string())) { std::map dateTimeMap = { { TemporalObject::YEAR_UNIT, dateTime->getYear() }, { TemporalObject::MONTH_UNIT, dateTime->getMonth() }, { TemporalObject::DAY_UNIT, dateTime->getDay() }, { TemporalObject::HOUR_UNIT, dateTime->getHour() }, { TemporalObject::MINUTE_UNIT, dateTime->getMinute() }, { TemporalObject::SECOND_UNIT, dateTime->getSecond() }, { TemporalObject::MILLISECOND_UNIT, dateTime->getMillisecond() }, { TemporalObject::MICROSECOND_UNIT, dateTime->getMicrosecond() }, { TemporalObject::NANOSECOND_UNIT, dateTime->getNanosecond() } }; std::map durationMap = { { TemporalObject::YEAR_UNIT, 0 }, { TemporalObject::MONTH_UNIT, 0 }, { TemporalObject::DAY_UNIT, 0 }, { TemporalObject::HOUR_UNIT, 0 }, { TemporalObject::MINUTE_UNIT, 0 }, { TemporalObject::SECOND_UNIT, 0 }, { TemporalObject::MILLISECOND_UNIT, 0 }, { TemporalObject::MICROSECOND_UNIT, 0 }, { TemporalObject::NANOSECOND_UNIT, -nanoseconds } }; auto earlier = TemporalPlainDateTimeObject::addDateTime(state, dateTimeMap, dateTime->getCalendar(), durationMap, nullptr); @@ -2736,7 +2736,7 @@ Value TemporalTimeZoneObject::disambiguatePossibleInstants(ExecutionState& state return possibleInstants[0]; } - ASSERT(disambiguation.asString()->equals(state.context()->staticStrings().lazylater().string()) || disambiguation.asString()->equals(state.context()->staticStrings().lazycompatible().string())); + ASSERT(disambiguation.asString()->equals(state.context()->staticStrings().lazyLater().string()) || disambiguation.asString()->equals(state.context()->staticStrings().lazyCompatible().string())); std::map dateTimeMap = { { TemporalObject::YEAR_UNIT, dateTime->getYear() }, { TemporalObject::MONTH_UNIT, dateTime->getMonth() }, { TemporalObject::DAY_UNIT, dateTime->getDay() }, { TemporalObject::HOUR_UNIT, dateTime->getHour() }, { TemporalObject::MINUTE_UNIT, dateTime->getMinute() }, { TemporalObject::SECOND_UNIT, dateTime->getSecond() }, { TemporalObject::MILLISECOND_UNIT, dateTime->getMillisecond() }, { TemporalObject::MICROSECOND_UNIT, dateTime->getMicrosecond() }, { TemporalObject::NANOSECOND_UNIT, dateTime->getNanosecond() } }; std::map durationMap = { { TemporalObject::YEAR_UNIT, 0 }, { TemporalObject::MONTH_UNIT, 0 }, { TemporalObject::DAY_UNIT, 0 }, { TemporalObject::HOUR_UNIT, 0 }, { TemporalObject::MINUTE_UNIT, 0 }, { TemporalObject::SECOND_UNIT, 0 }, { TemporalObject::MILLISECOND_UNIT, 0 }, { TemporalObject::MICROSECOND_UNIT, 0 }, { TemporalObject::NANOSECOND_UNIT, nanoseconds } }; @@ -2800,7 +2800,7 @@ Value TemporalPlainYearMonthObject::toTemporalYearMonth(ExecutionState& state, c StaticStrings& strings = state.context()->staticStrings(); auto calendar = TemporalCalendarObject::getTemporalCalendarWithISODefault(state, item); - auto fieldNames = TemporalCalendarObject::calendarFields(state, calendar, { strings.lazyMonth().string(), strings.lazymonthCode().string(), strings.lazyYear().string() }); + auto fieldNames = TemporalCalendarObject::calendarFields(state, calendar, { strings.lazyMonth().string(), strings.lazyMonthCode().string(), strings.lazyYear().string() }); auto fields = Temporal::prepareTemporalFields(state, item, fieldNames, {}); return TemporalCalendarObject::calendarYearMonthFromFields(state, calendar, fields, options); } @@ -2824,7 +2824,7 @@ Value TemporalPlainYearMonthObject::addDurationToOrSubtractDurationFromPlainYear std::map tmp = { { TemporalObject::DAY_UNIT, duration->getDay() }, { TemporalObject::HOUR_UNIT, duration->getHour() }, { TemporalObject::MINUTE_UNIT, duration->getMinute() }, { TemporalObject::SECOND_UNIT, duration->getSecond() }, { TemporalObject::MILLISECOND_UNIT, duration->getMillisecond() }, { TemporalObject::MICROSECOND_UNIT, duration->getMicrosecond() }, { TemporalObject::NANOSECOND_UNIT, duration->getNanosecond() } }; std::map balanceResult = TemporalDurationObject::balanceDuration(state, tmp, TemporalObject::DAY_UNIT); Value optionsObject = Temporal::getOptionsObject(state, options); - ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, yearMonth->getCalendar(), { Value(state.context()->staticStrings().lazymonthCode().string()), Value(state.context()->staticStrings().lazyYear().string()) }); + ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, yearMonth->getCalendar(), { Value(state.context()->staticStrings().lazyMonthCode().string()), Value(state.context()->staticStrings().lazyYear().string()) }); Value fields = Temporal::prepareTemporalFields(state, yearMonth, fieldNames, {}); int durationArray[] = { duration->getYear(), duration->getMonth(), duration->getWeek(), balanceResult[TemporalObject::DAY_UNIT], 0, 0, 0, 0, 0, 0 }; int sign = TemporalDurationObject::durationSign(durationArray); @@ -3023,12 +3023,12 @@ std::map TemporalDurationObject::addDuration Value calendar = dateTime->getCalendar(); Value dateDuration1 = TemporalDurationObject::createTemporalDuration(state, first[TemporalObject::YEAR_UNIT], first[TemporalObject::MONTH_UNIT], first[TemporalObject::WEEK_UNIT], first[TemporalObject::DAY_UNIT], 0, 0, 0, 0, 0, 0); Value dateDuration2 = TemporalDurationObject::createTemporalDuration(state, second[TemporalObject::YEAR_UNIT], second[TemporalObject::MONTH_UNIT], second[TemporalObject::WEEK_UNIT], second[TemporalObject::DAY_UNIT], 0, 0, 0, 0, 0, 0); - Value dateAdd = Object::getMethod(state, calendar, ObjectPropertyName(state, state.context()->staticStrings().lazydateAdd().string())); + Value dateAdd = Object::getMethod(state, calendar, ObjectPropertyName(state, state.context()->staticStrings().lazyDateAdd().string())); Value intermediate = TemporalCalendarObject::calendarDateAdd(state, calendar, relativeTo, dateDuration1, Value(), dateAdd); Value end = TemporalCalendarObject::calendarDateAdd(state, calendar, intermediate, dateDuration2, Value(), dateAdd); auto dateLargestUnit = TemporalObject::DAY_UNIT > largestUnit ? TemporalObject::DAY_UNIT : largestUnit; auto differenceOptions = new Object(state, Object::PrototypeIsNull); - differenceOptions->defineOwnProperty(state, ObjectPropertyName(state.context()->staticStrings().lazylargestUnit()), ObjectPropertyDescriptor(TemporalObject::dateTimeUnitString(state, dateLargestUnit), ObjectPropertyDescriptor::AllPresent)); + differenceOptions->defineOwnProperty(state, ObjectPropertyName(state.context()->staticStrings().lazyLargestUnit()), ObjectPropertyDescriptor(TemporalObject::dateTimeUnitString(state, dateLargestUnit), ObjectPropertyDescriptor::AllPresent)); auto dateDifference = TemporalCalendarObject::calendarDateUntil(state, calendar, relativeTo, end, differenceOptions).asObject()->asTemporalDurationObject(); duration[TemporalObject::DAY_UNIT] = dateDifference->getDay(); auto result = TemporalDurationObject::balanceDuration(state, duration, largestUnit); @@ -3237,10 +3237,10 @@ Value TemporalPlainMonthDayObject::toTemporalMonthDay(ExecutionState& state, con calendar = TemporalCalendarObject::toTemporalCalendarWithISODefault(state, calendarLike).asObject()->asTemporalCalendarObject(); } - ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, calendar, { strings.lazyDay().string(), strings.lazyMonth().string(), strings.lazymonthCode().string(), strings.lazyYear().string() }); + ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, calendar, { strings.lazyDay().string(), strings.lazyMonth().string(), strings.lazyMonthCode().string(), strings.lazyYear().string() }); Value fields = Temporal::prepareTemporalFields(state, item, fieldNames, {}); Value month = fields.asObject()->get(state, strings.lazyMonth()).value(state, fields); - Value monthCode = fields.asObject()->get(state, strings.lazymonthCode()).value(state, fields); + Value monthCode = fields.asObject()->get(state, strings.lazyMonthCode()).value(state, fields); Value year = fields.asObject()->get(state, strings.lazyYear()).value(state, fields); if (calendarAbsent && month.isUndefined() && monthCode.isUndefined() && year.isUndefined()) { From 3ff29de584fa6817afa84f6359119dc2dd56e165 Mon Sep 17 00:00:00 2001 From: HyukWoo Park Date: Tue, 10 Dec 2024 21:04:10 +0900 Subject: [PATCH 2/2] Refactor TemporalObject * merge Temporal into TemporalObject * add each Temporal prototype object into global object Signed-off-by: HyukWoo Park --- src/builtins/BuiltinTemporal.cpp | 478 +++++++++++++++---------------- src/runtime/GlobalObject.h | 20 +- src/runtime/Temporal.h | 231 --------------- src/runtime/TemporalObject.cpp | 401 ++++++++++++++------------ src/runtime/TemporalObject.h | 99 +++++-- 5 files changed, 546 insertions(+), 683 deletions(-) delete mode 100644 src/runtime/Temporal.h diff --git a/src/builtins/BuiltinTemporal.cpp b/src/builtins/BuiltinTemporal.cpp index f8d601173..8ea1a17e0 100644 --- a/src/builtins/BuiltinTemporal.cpp +++ b/src/builtins/BuiltinTemporal.cpp @@ -158,7 +158,7 @@ static Value builtinTemporalPlainDateFrom(ExecutionState& state, Value thisValue } if (argv[0].isObject() && argv[0].asObject()->isTemporalPlainDateObject()) { - Temporal::toTemporalOverflow(state, argc > 1 ? Value(argv[1].asObject()) : Value()); + TemporalObject::toTemporalOverflow(state, argc > 1 ? Value(argv[1].asObject()) : Value()); TemporalPlainDateObject* plainDate = argv[0].asObject()->asTemporalPlainDateObject(); return TemporalPlainDateObject::createTemporalDate(state, plainDate->year(), plainDate->month(), plainDate->day(), plainDate->getCalendar()); } @@ -248,7 +248,7 @@ static Value builtinTemporalPlainDatePrototypeAdd(ExecutionState& state, Value t CHECK_TEMPORAL_PLAIN_DATE(state, thisValue); auto duration = TemporalDurationObject::toTemporalDuration(state, argv[0]); - auto options = Temporal::getOptionsObject(state, argc > 2 ? argv[1] : Value()); + auto options = TemporalObject::getOptionsObject(state, argc > 2 ? argv[1] : Value()); return TemporalCalendarObject::calendarDateAdd(state, thisValue.asObject()->asTemporalPlainDateObject()->getCalendar(), thisValue, duration, options); } @@ -257,7 +257,7 @@ static Value builtinTemporalPlainDatePrototypeSubtract(ExecutionState& state, Va CHECK_TEMPORAL_PLAIN_DATE(state, thisValue); auto duration = TemporalDurationObject::createNegatedTemporalDuration(state, TemporalDurationObject::toTemporalDuration(state, argv[0])); - auto options = Temporal::getOptionsObject(state, argc > 2 ? argv[1] : Value()); + auto options = TemporalObject::getOptionsObject(state, argc > 2 ? argv[1] : Value()); return TemporalCalendarObject::calendarDateAdd(state, thisValue.asObject()->asTemporalPlainDateObject()->getCalendar(), thisValue, duration, options); } @@ -279,8 +279,8 @@ static Value builtinTemporalPlainTimeConstructor(ExecutionState& state, Value th static Value builtinTemporalPlainTimeFrom(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) { - Value options = Temporal::getOptionsObject(state, argc > 1 ? argv[1] : Value()); - options = Temporal::toTemporalOverflow(state, options); + Value options = TemporalObject::getOptionsObject(state, argc > 1 ? argv[1] : Value()); + options = TemporalObject::toTemporalOverflow(state, options); if (argv[0].isObject() && argv[0].asObject()->isTemporalPlainTimeObject()) { TemporalPlainTimeObject* item = argv[0].asObject()->asTemporalPlainTimeObject(); @@ -365,11 +365,11 @@ static Value builtinTemporalPlainTimeWith(ExecutionState& state, Value thisValue ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, "temporalTimeLike is not an Object"); } - Temporal::rejectObjectWithCalendarOrTimeZone(state, argv[0]); + TemporalObject::rejectObjectWithCalendarOrTimeZone(state, argv[0]); auto partialTime = TemporalPlainTimeObject::toPartialTime(state, argv[0]); - Value overFlow = Temporal::toTemporalOverflow(state, Temporal::getOptionsObject(state, argc > 1 ? argv[1] : Value())); + Value overFlow = TemporalObject::toTemporalOverflow(state, TemporalObject::getOptionsObject(state, argc > 1 ? argv[1] : Value())); auto result = TemporalPlainTimeObject::regulateTime(state, partialTime[TemporalObject::HOUR_UNIT].isUndefined() ? partialTime[TemporalObject::HOUR_UNIT].asInt32() : temporalTime->getHour(), @@ -443,7 +443,7 @@ static Value builtinTemporalPlainDateTimeFrom(ExecutionState& state, Value thisV } if (argv[0].isObject() && argv[0].asObject()->isTemporalPlainDateTimeObject()) { - Temporal::toTemporalOverflow(state, argc > 1 ? Value(argv[1].asObject()) : Value()); + TemporalObject::toTemporalOverflow(state, argc > 1 ? Value(argv[1].asObject()) : Value()); TemporalPlainDateTimeObject* plainDateTime = argv[0].asObject()->asTemporalPlainDateTimeObject(); return TemporalPlainDateTimeObject::createTemporalDateTime(state, plainDateTime->getYear(), plainDateTime->getMonth(), plainDateTime->getDay(), plainDateTime->getHour(), @@ -571,12 +571,12 @@ static Value builtinTemporalZonedDateTimeConstructor(ExecutionState& state, Valu static Value builtinTemporalZonedDateTimeFrom(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) { - Value options = Temporal::getOptionsObject(state, argc > 1 ? argv[1] : Value()); + Value options = TemporalObject::getOptionsObject(state, argc > 1 ? argv[1] : Value()); if (argv[0].isObject() && argv[0].asObject()->isTemporalZonedDateTimeObject()) { - Temporal::toTemporalOverflow(state, options); - Temporal::toTemporalDisambiguation(state, options); - Temporal::toTemporalOffset(state, options, Value(state.context()->staticStrings().reject.string())); + TemporalObject::toTemporalOverflow(state, options); + TemporalObject::toTemporalDisambiguation(state, options); + TemporalObject::toTemporalOffset(state, options, Value(state.context()->staticStrings().reject.string())); auto item = argv[0].asObject()->asTemporalZonedDateTimeObject(); return TemporalZonedDateTimeObject::createTemporalZonedDateTime(state, *(item->getNanoseconds()), item->getTimeZone(), item->getCalendar()); } @@ -954,10 +954,10 @@ static Value builtinTemporalPlainYearMonthConstructor(ExecutionState& state, Val static Value builtinTemporalPlainYearMonthFrom(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) { - auto options = Temporal::getOptionsObject(state, argc == 2 ? argv[1] : Value()); + auto options = TemporalObject::getOptionsObject(state, argc == 2 ? argv[1] : Value()); if (argv[0].isObject() && argv[0].asObject()->isTemporalPlainYearMonthObject()) { - Temporal::toTemporalOverflow(state, options); + TemporalObject::toTemporalOverflow(state, options); auto item = argv[0].asObject()->asTemporalPlainYearMonthObject(); return TemporalPlainYearMonthObject::createTemporalYearMonth(state, item->getIsoYear(), item->getIsoMonth(), item->getCalendar(), item->getReferenceIsoDay()); } @@ -1200,10 +1200,10 @@ static Value builtinTemporalPlainMonthDayConstructor(ExecutionState& state, Valu static Value builtinTemporalPlainMonthDayFrom(ExecutionState& state, Value thisValue, size_t argc, Value* argv, Optional newTarget) { - auto options = Temporal::getOptionsObject(state, argc >= 2 ? argv[1] : Value()); + auto options = TemporalObject::getOptionsObject(state, argc >= 2 ? argv[1] : Value()); if (argv[0].isObject() && argv[0].asObject()->isTemporalPlainMonthDayObject()) { - Temporal::toTemporalOverflow(state, options); + TemporalObject::toTemporalOverflow(state, options); auto item = argv[0].asObject()->asTemporalPlainMonthDayObject(); return TemporalPlainMonthDayObject::createTemporalMonthDay(state, item->getIsoMonth(), item->getIsoDay(), item->getCalendar(), item->getReferenceIsoYear()); } @@ -1629,96 +1629,96 @@ void GlobalObject::installTemporal(ExecutionState& state) auto temporalPlainDate = new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDate(), builtinTemporalPlainDateConstructor, 4), NativeFunctionObject::__ForBuiltinConstructor__); temporalPlainDate->setGlobalIntrinsicObject(state); - auto temporalPlainDatePrototype = new PrototypeObject(state); - temporalPlainDatePrototype->setGlobalIntrinsicObject(state, true); + m_temporalPlainDatePrototype = new PrototypeObject(state); + m_temporalPlainDatePrototype->setGlobalIntrinsicObject(state, true); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainDate, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainDate, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); JSGetterSetter dateCalendarGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->calendar, builtinTemporalPlainDateCalendar, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateCalendarDesc(dateCalendarGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), dateCalendarDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), dateCalendarDesc); JSGetterSetter dateYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYear(), builtinTemporalPlainDateYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateYearDesc(dateYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), dateYearDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), dateYearDesc); JSGetterSetter dateMonthGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonth(), builtinTemporalPlainDateMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateMonthDesc(dateMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), dateMonthDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), dateMonthDesc); JSGetterSetter dateMonthCodeGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalPlainDateMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateMonthCodeDesc(dateMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), dateMonthCodeDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), dateMonthCodeDesc); JSGetterSetter dateDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalPlainDateDay, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDayDesc(dateDayGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), dateDayDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), dateDayDesc); JSGetterSetter dateDayOfWeekGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalPlainDateDayOfWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDayOfWeekDesc(dateDayOfWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), dateDayOfWeekDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), dateDayOfWeekDesc); JSGetterSetter dateDayOfYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalPlainDateDayOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDayOfYearDesc(dateDayOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), dateDayOfYearDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), dateDayOfYearDesc); JSGetterSetter dateWeekOfYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalPlainDateWeekOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateWeekOfYearDesc(dateWeekOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), dateWeekOfYearDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), dateWeekOfYearDesc); JSGetterSetter dateDaysInWeekGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalPlainDateDaysInWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDaysInWeekDesc(dateDaysInWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), dateDaysInWeekDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), dateDaysInWeekDesc); JSGetterSetter dateDaysInMonthGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalPlainDateDaysInMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDaysInMonthDesc(dateDaysInMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), dateDaysInMonthDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), dateDaysInMonthDesc); JSGetterSetter dateDaysInYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalPlainDateDaysInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateDaysInYearDesc(dateDaysInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), dateDaysInYearDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), dateDaysInYearDesc); JSGetterSetter dateMonthsInYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalPlainDateMonthsInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateMonthsInYearDesc(dateMonthsInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), dateMonthsInYearDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), dateMonthsInYearDesc); JSGetterSetter dateInLeapYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalPlainDateInLeapYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateInLeapYearDesc(dateInLeapYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), dateInLeapYearDesc); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), dateInLeapYearDesc); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainDatePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainDatePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainDatePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainDatePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainDatePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainDate->setFunctionPrototype(state, temporalPlainDatePrototype); + temporalPlainDate->setFunctionPrototype(state, m_temporalPlainDatePrototype); temporalPlainDate->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalPlainDateFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -1726,10 +1726,10 @@ void GlobalObject::installTemporal(ExecutionState& state) auto temporalPlainTime = new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyTime(), builtinTemporalPlainTimeConstructor, 0), NativeFunctionObject::__ForBuiltinConstructor__); temporalPlainTime->setGlobalIntrinsicObject(state); - auto temporalPlainTimePrototype = new PrototypeObject(state); - temporalPlainTimePrototype->setGlobalIntrinsicObject(state, true); + m_temporalPlainTimePrototype = new PrototypeObject(state); + m_temporalPlainTimePrototype->setGlobalIntrinsicObject(state, true); - temporalPlainTimePrototype->defineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainTime, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainTimePrototype->defineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainTime, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); temporalPlainTime->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalPlainTimeFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -1741,158 +1741,158 @@ void GlobalObject::installTemporal(ExecutionState& state) new NativeFunctionObject(state, NativeFunctionInfo(strings->calendar, builtinTemporalPlainTimeCalendar, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeCalendarDesc(timeCalendarGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), timeCalendarDesc); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), timeCalendarDesc); JSGetterSetter timeHourGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyHour(), builtinTemporalPlainTimeHour, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeHourDesc(timeHourGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHour()), timeHourDesc); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHour()), timeHourDesc); JSGetterSetter timeMinuteGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMinute(), builtinTemporalPlainTimeMinute, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeMinuteDesc(timeMinuteGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMinute()), timeMinuteDesc); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMinute()), timeMinuteDesc); JSGetterSetter timeSecondGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySecond(), builtinTemporalPlainTimeSecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeSecondDesc(timeSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySecond()), timeSecondDesc); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySecond()), timeSecondDesc); JSGetterSetter timeMilliSecondGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMillisecond(), builtinTemporalPlainTimeMilliSecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeMilliSecondDesc(timeMilliSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMillisecond()), timeMilliSecondDesc); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMillisecond()), timeMilliSecondDesc); JSGetterSetter timeMicroSecondGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMicrosecond(), builtinTemporalPlainTimeMicroSecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeMicroSecondDesc(timeMicroSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMicrosecond()), timeMicroSecondDesc); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMicrosecond()), timeMicroSecondDesc); JSGetterSetter timeNanoSecondGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyNanosecond(), builtinTemporalPlainTimeNanoSecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeNanoSecondDesc(timeNanoSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNanosecond()), timeNanoSecondDesc); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNanosecond()), timeNanoSecondDesc); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainTimePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainTimePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->with), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->with, builtinTemporalPlainTimeWith, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->with), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->with, builtinTemporalPlainTimeWith, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEquals()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEquals(), builtinTemporalPlainTimeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEquals()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEquals(), builtinTemporalPlainTimeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetISOFields()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetISOFields(), builtinTemporalPlainTimeGetISOFields, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetISOFields()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetISOFields(), builtinTemporalPlainTimeGetISOFields, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyToPlainDateTime()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyToPlainDateTime(), builtinTemporalPlainTimeToPlainDateTime, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyToPlainDateTime()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyToPlainDateTime(), builtinTemporalPlainTimeToPlainDateTime, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainTime->setFunctionPrototype(state, temporalPlainTimePrototype); + temporalPlainTime->setFunctionPrototype(state, m_temporalPlainTimePrototype); auto temporalPlainDateTime = new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDateTime(), builtinTemporalPlainDateTimeConstructor, 3), NativeFunctionObject::__ForBuiltinConstructor__); temporalPlainDateTime->setGlobalIntrinsicObject(state); - auto temporalPlainDateTimePrototype = new PrototypeObject(state); - temporalPlainDateTimePrototype->setGlobalIntrinsicObject(state, true); + m_temporalPlainDateTimePrototype = new PrototypeObject(state); + m_temporalPlainDateTimePrototype->setGlobalIntrinsicObject(state, true); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainDateTime, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainDateTime, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); JSGetterSetter dateTimeCalendarGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->calendar, builtinTemporalPlainDateTimeCalendar, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeCalendarDesc(dateTimeCalendarGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), dateTimeCalendarDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), dateTimeCalendarDesc); JSGetterSetter dateTimeYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYear(), builtinTemporalPlainDateTimeYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeYearDesc(dateTimeYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), dateTimeYearDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), dateTimeYearDesc); JSGetterSetter dateTimeMonthGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonth(), builtinTemporalPlainDateTimeMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeMonthDesc(dateTimeMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), dateTimeMonthDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), dateTimeMonthDesc); JSGetterSetter dateTimeMonthCodeGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalPlainDateTimeMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeMonthCodeDesc(dateTimeMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), dateTimeMonthCodeDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), dateTimeMonthCodeDesc); JSGetterSetter dateTimeDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalPlainDateTimeDay, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDayDesc(dateTimeDayGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), dateTimeDayDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), dateTimeDayDesc); JSGetterSetter dateTimeDayOfWeekGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalPlainDateTimeDayOfWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDayOfWeekDesc(dateTimeDayOfWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), dateTimeDayOfWeekDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), dateTimeDayOfWeekDesc); JSGetterSetter dateTimeDayOfYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalPlainDateTimeDayOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDayOfYearDesc(dateTimeDayOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), dateTimeDayOfYearDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), dateTimeDayOfYearDesc); JSGetterSetter dateTimeWeekOfYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalPlainDateTimeWeekOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeWeekOfYearDesc(dateTimeWeekOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), dateTimeWeekOfYearDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), dateTimeWeekOfYearDesc); JSGetterSetter dateTimeDaysInWeekGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalPlainDateTimeDaysInWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDaysInWeekDesc(dateTimeDaysInWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), dateTimeDaysInWeekDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), dateTimeDaysInWeekDesc); JSGetterSetter dateTimeDaysInMonthGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalPlainDateTimeDaysInMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDaysInMonthDesc(dateTimeDaysInMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), dateTimeDaysInMonthDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), dateTimeDaysInMonthDesc); JSGetterSetter dateTimeDaysInYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalPlainDateTimeDaysInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeDaysInYearDesc(dateTimeDaysInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), dateTimeDaysInYearDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), dateTimeDaysInYearDesc); JSGetterSetter dateTimeMonthsInYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalPlainDateTimeMonthsInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeMonthsInYearDesc(dateTimeMonthsInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), dateTimeMonthsInYearDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), dateTimeMonthsInYearDesc); JSGetterSetter dateTimeInLeapYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalPlainDateTimeInLeapYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor dateTimeInLeapYearDesc(dateTimeInLeapYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), dateTimeInLeapYearDesc); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), dateTimeInLeapYearDesc); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainDateTimePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainDateTimePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainDateTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainDateTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainDateTime->setFunctionPrototype(state, temporalPlainDateTimePrototype); + temporalPlainDateTime->setFunctionPrototype(state, m_temporalPlainDateTimePrototype); temporalPlainDateTime->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalPlainDateTimeFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -1900,180 +1900,180 @@ void GlobalObject::installTemporal(ExecutionState& state) auto temporalZonedDateTime = new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDateTime(), builtinTemporalZonedDateTimeConstructor, 3), NativeFunctionObject::__ForBuiltinConstructor__); temporalZonedDateTime->setGlobalIntrinsicObject(state); - auto temporalZonedDateTimePrototype = new PrototypeObject(state); - temporalZonedDateTimePrototype->setGlobalIntrinsicObject(state, true); + m_temporalZonedDateTimePrototype = new PrototypeObject(state); + m_temporalZonedDateTimePrototype->setGlobalIntrinsicObject(state, true); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalZonedDateTime, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalZonedDateTime, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); JSGetterSetter zonedDateTimeCalendarGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->calendar, builtinTemporalZonedDateTimeCalendar, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeCalendarDesc(zonedDateTimeCalendarGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), zonedDateTimeCalendarDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), zonedDateTimeCalendarDesc); JSGetterSetter zonedDateTimeTimeZoneGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyTimeZone(), builtinTemporalZonedDateTimeTimeZone, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeTimeZoneDesc(zonedDateTimeTimeZoneGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyTimeZone()), zonedDateTimeTimeZoneDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyTimeZone()), zonedDateTimeTimeZoneDesc); JSGetterSetter zonedDateTimeYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYear(), builtinTemporalZonedDateTimeYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeYearDesc(zonedDateTimeYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), zonedDateTimeYearDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), zonedDateTimeYearDesc); JSGetterSetter zonedDateTimeMonthGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonth(), builtinTemporalZonedDateTimeMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMonthDesc(zonedDateTimeMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), zonedDateTimeMonthDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), zonedDateTimeMonthDesc); JSGetterSetter zonedDateTimeMonthCodeGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalZonedDateTimeMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMonthCodeDesc(zonedDateTimeMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), zonedDateTimeMonthCodeDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), zonedDateTimeMonthCodeDesc); JSGetterSetter zonedDateTimeDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalZonedDateTimeDay, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDayDesc(zonedDateTimeDayGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), zonedDateTimeDayDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), zonedDateTimeDayDesc); JSGetterSetter zonedDateTimeHourGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyHour(), builtinTemporalZonedDateTimeHour, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeHourDesc(zonedDateTimeHourGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHour()), zonedDateTimeHourDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHour()), zonedDateTimeHourDesc); JSGetterSetter zonedDateTimeMinuteGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMinute(), builtinTemporalZonedDateTimeMinute, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMinuteDesc(zonedDateTimeMinuteGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMinute()), zonedDateTimeMinuteDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMinute()), zonedDateTimeMinuteDesc); JSGetterSetter zonedDateTimeSecondGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySecond(), builtinTemporalZonedDateTimeSecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeSecondDesc(zonedDateTimeSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySecond()), zonedDateTimeSecondDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySecond()), zonedDateTimeSecondDesc); JSGetterSetter zonedDateTimeMillisecondGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMillisecond(), builtinTemporalZonedDateTimeMillisecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMillisecondDesc(zonedDateTimeMillisecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMillisecond()), zonedDateTimeMillisecondDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMillisecond()), zonedDateTimeMillisecondDesc); JSGetterSetter zonedDateTimeMicrosecondGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMicrosecond(), builtinTemporalZonedDateTimeMicrosecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMicrosecondDesc(zonedDateTimeMicrosecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMicrosecond()), zonedDateTimeMicrosecondDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMicrosecond()), zonedDateTimeMicrosecondDesc); JSGetterSetter zonedDateTimeNanosecondGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyNanosecond(), builtinTemporalZonedDateTimeNanosecond, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeNanosecondDesc(zonedDateTimeNanosecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNanosecond()), zonedDateTimeNanosecondDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNanosecond()), zonedDateTimeNanosecondDesc); JSGetterSetter zonedDateTimeEpochSecondGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochSeconds(), builtinTemporalZonedDateTimeEpochSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeEpochSecondsDesc(zonedDateTimeEpochSecondGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochSeconds()), zonedDateTimeEpochSecondsDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochSeconds()), zonedDateTimeEpochSecondsDesc); JSGetterSetter zonedDateTimeEpochMillisecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochMicroseconds(), builtinTemporalZonedDateTimeEpochMicroSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeEpochMillisecondsDesc(zonedDateTimeEpochMillisecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMicroseconds()), zonedDateTimeEpochMillisecondsDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMicroseconds()), zonedDateTimeEpochMillisecondsDesc); JSGetterSetter zonedDateTimeEpochMicrosecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochMilliseconds(), builtinTemporalZonedDateTimeEpochMilliSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeEpochMicrosecondsDesc(zonedDateTimeEpochMicrosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMilliseconds()), zonedDateTimeEpochMicrosecondsDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMilliseconds()), zonedDateTimeEpochMicrosecondsDesc); JSGetterSetter zonedDateTimeEpochNanosecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochNanoseconds(), builtinTemporalZonedDateTimeEpochNanoSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeEpochNanosecondsDesc(zonedDateTimeEpochNanosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochNanoseconds()), zonedDateTimeEpochNanosecondsDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochNanoseconds()), zonedDateTimeEpochNanosecondsDesc); JSGetterSetter zonedDateTimeDayOfWeekGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalZonedDateTimeDayOfWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDayOfWeekDesc(zonedDateTimeDayOfWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), zonedDateTimeDayOfWeekDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), zonedDateTimeDayOfWeekDesc); JSGetterSetter zonedDateTimeDayOfYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalZonedDateTimeDayOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDayOfYearDesc(zonedDateTimeDayOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), zonedDateTimeDayOfYearDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), zonedDateTimeDayOfYearDesc); JSGetterSetter zonedDateTimeWeekOfYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalZonedDateTimeWeekOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeWeekOfYearDesc(zonedDateTimeWeekOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), zonedDateTimeWeekOfYearDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), zonedDateTimeWeekOfYearDesc); JSGetterSetter zonedDateTimeHoursInDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyHoursInDay(), builtinTemporalZonedDateTimeHoursInDay, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeHoursInDayDesc(zonedDateTimeHoursInDayGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHoursInDay()), zonedDateTimeHoursInDayDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHoursInDay()), zonedDateTimeHoursInDayDesc); JSGetterSetter zonedDateTimeDaysInWeekGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalZonedDateTimeDaysInWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDaysInWeekDesc(zonedDateTimeDaysInWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), zonedDateTimeDaysInWeekDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), zonedDateTimeDaysInWeekDesc); JSGetterSetter zonedDateTimeDaysInMonthGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalZonedDateTimeDaysInMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDaysInMonthDesc(zonedDateTimeDaysInMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), zonedDateTimeDaysInMonthDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), zonedDateTimeDaysInMonthDesc); JSGetterSetter zonedDateTimeDaysInYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalZonedDateTimeDaysInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeDaysInYearDesc(zonedDateTimeDaysInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), zonedDateTimeDaysInYearDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), zonedDateTimeDaysInYearDesc); JSGetterSetter zonedDateTimeMonthsInYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalZonedDateTimeMonthsInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeMonthsInYearDesc(zonedDateTimeMonthsInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), zonedDateTimeMonthsInYearDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), zonedDateTimeMonthsInYearDesc); JSGetterSetter zonedDateTimeInLeapYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalZonedDateTimeInLeapYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeInLeapYearDesc(zonedDateTimeInLeapYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), zonedDateTimeInLeapYearDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), zonedDateTimeInLeapYearDesc); JSGetterSetter zonedDateTimeOffsetNanosecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyOffsetNanoseconds(), builtinTemporalZonedDateTimeOffsetNanoseconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeOffsetNanosecondsDesc(zonedDateTimeOffsetNanosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyOffsetNanoseconds()), zonedDateTimeOffsetNanosecondsDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyOffsetNanoseconds()), zonedDateTimeOffsetNanosecondsDesc); JSGetterSetter zonedDateTimeOffsetGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyOffset(), builtinTemporalZonedDateTimeOffset, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor zonedDateTimeOffsetDesc(zonedDateTimeOffsetGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyOffset()), zonedDateTimeOffsetDesc); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyOffset()), zonedDateTimeOffsetDesc); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalZonedDateTimePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalZonedDateTimePrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalZonedDateTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalZonedDateTimePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalZonedDateTimePrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalZonedDateTime->setFunctionPrototype(state, temporalZonedDateTimePrototype); + temporalZonedDateTime->setFunctionPrototype(state, m_temporalZonedDateTimePrototype); temporalZonedDateTime->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalZonedDateTimeFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -2083,94 +2083,94 @@ void GlobalObject::installTemporal(ExecutionState& state) auto temporalDuration = new NativeFunctionObject(state, NativeFunctionInfo(strings->constructor, builtinTemporalDurationConstructor, 0), NativeFunctionObject::__ForBuiltinConstructor__); temporalDuration->setGlobalIntrinsicObject(state); - auto temporalDurationPrototype = new PrototypeObject(state); - temporalDurationPrototype->setGlobalIntrinsicObject(state, true); + m_temporalDurationPrototype = new PrototypeObject(state); + m_temporalDurationPrototype->setGlobalIntrinsicObject(state, true); JSGetterSetter durationYearsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYears(), builtinTemporalDurationPrototypeYears, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationYearsDesc(durationYearsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYears()), durationYearsDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYears()), durationYearsDesc); JSGetterSetter durationMonthsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonths(), builtinTemporalDurationPrototypeMonths, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationMonthsDesc(durationMonthsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonths()), durationMonthsDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonths()), durationMonthsDesc); JSGetterSetter durationWeeksGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeeks(), builtinTemporalDurationPrototypeWeeks, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationWeeksDesc(durationWeeksGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeeks()), durationWeeksDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeeks()), durationWeeksDesc); JSGetterSetter durationDaysGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDays(), builtinTemporalDurationPrototypeDays, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationDaysDesc(durationDaysGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDays()), durationDaysDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDays()), durationDaysDesc); JSGetterSetter durationYHoursGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyHours(), builtinTemporalDurationPrototypeHours, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationHoursDesc(durationYHoursGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHours()), durationHoursDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyHours()), durationHoursDesc); JSGetterSetter durationMinutesGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMinutes(), builtinTemporalDurationPrototypeMinutes, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationMinutesDesc(durationMinutesGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMinutes()), durationMinutesDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMinutes()), durationMinutesDesc); JSGetterSetter durationSecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySeconds(), builtinTemporalDurationPrototypeSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationSecondsDesc(durationSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySeconds()), durationSecondsDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySeconds()), durationSecondsDesc); JSGetterSetter durationMilliSecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMilliseconds(), builtinTemporalDurationPrototypeMilliSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationMilliSecondsDesc(durationMilliSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMilliseconds()), durationMilliSecondsDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMilliseconds()), durationMilliSecondsDesc); JSGetterSetter durationMicroSecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMicroseconds(), builtinTemporalDurationPrototypeMicroSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationMicroSecondsDesc(durationMicroSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMicroseconds()), durationMicroSecondsDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMicroseconds()), durationMicroSecondsDesc); JSGetterSetter durationNanoSecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyNanoseconds(), builtinTemporalDurationPrototypeNanoSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationNanoSecondsDesc(durationNanoSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNanoseconds()), durationNanoSecondsDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNanoseconds()), durationNanoSecondsDesc); JSGetterSetter durationSignGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->sign, builtinTemporalDurationPrototypeSign, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationSignDesc(durationSignGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->sign), durationSignDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->sign), durationSignDesc); JSGetterSetter durationBlankGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyBlank(), builtinTemporalDurationPrototypeBlank, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor durationBlankDesc(durationBlankGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyBlank()), durationBlankDesc); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyBlank()), durationBlankDesc); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalDurationPrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalDurationPrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalDurationPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalDurationPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->abs), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->abs, builtinTemporalDurationPrototypeAbs, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->abs), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->abs, builtinTemporalDurationPrototypeAbs, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNegated()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyNegated(), builtinTemporalDurationPrototypeNegated, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyNegated()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyNegated(), builtinTemporalDurationPrototypeNegated, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalDuration->setFunctionPrototype(state, temporalDurationPrototype); + temporalDuration->setFunctionPrototype(state, m_temporalDurationPrototype); temporalDuration->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalDurationFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -2178,8 +2178,8 @@ void GlobalObject::installTemporal(ExecutionState& state) auto temporalPlainYearMonth = new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyPlainYearMonth(), builtinTemporalPlainYearMonthConstructor, 2), NativeFunctionObject::__ForBuiltinConstructor__); temporalPlainYearMonth->setGlobalIntrinsicObject(state); - auto temporalPlainYearMonthPrototype = new PrototypeObject(state); - temporalPlainYearMonthPrototype->setGlobalIntrinsicObject(state, true); + m_temporalPlainYearMonthPrototype = new PrototypeObject(state); + m_temporalPlainYearMonthPrototype->setGlobalIntrinsicObject(state, true); temporalPlainYearMonth->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalPlainYearMonthFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -2191,92 +2191,92 @@ void GlobalObject::installTemporal(ExecutionState& state) new NativeFunctionObject(state, NativeFunctionInfo(strings->calendar, builtinTemporalPlainYearMonthCalendar, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthCalendarDesc(yearMonthCalendarGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), yearMonthCalendarDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), yearMonthCalendarDesc); JSGetterSetter yearMonthYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYear(), builtinTemporalPlainYearMonthYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthYearDesc(yearMonthYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), yearMonthYearDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), yearMonthYearDesc); JSGetterSetter yearMonthMonthGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonth(), builtinTemporalPlainYearMonthMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthMonthDesc(yearMonthMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), yearMonthMonthDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), yearMonthMonthDesc); JSGetterSetter yearMonthMonthCodeGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalPlainYearMonthMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthMonthCodeDesc(yearMonthMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), yearMonthMonthCodeDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), yearMonthMonthCodeDesc); JSGetterSetter yearMonthDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalPlainYearMonthDay, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDayDesc(yearMonthDayGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), yearMonthDayDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), yearMonthDayDesc); JSGetterSetter yearMonthDayOfWeekGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalPlainYearMonthDayOfWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDayOfWeekDesc(yearMonthDayOfWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), yearMonthDayOfWeekDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), yearMonthDayOfWeekDesc); JSGetterSetter yearMonthDayOfYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalPlainYearMonthDayOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDayOfYearDesc(yearMonthDayOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), yearMonthDayOfYearDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), yearMonthDayOfYearDesc); JSGetterSetter yearMonthWeekOfYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalPlainYearMonthWeekOfYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthWeekOfYearDesc(yearMonthWeekOfYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), yearMonthWeekOfYearDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), yearMonthWeekOfYearDesc); JSGetterSetter yearMonthDaysInWeekGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalPlainYearMonthDaysInWeek, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDaysInWeekDesc(yearMonthDaysInWeekGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), yearMonthDaysInWeekDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), yearMonthDaysInWeekDesc); JSGetterSetter yearMonthDaysInMonthGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalPlainYearMonthDaysInMonth, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDaysInMonthDesc(yearMonthDaysInMonthGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), yearMonthDaysInMonthDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), yearMonthDaysInMonthDesc); JSGetterSetter yearMonthDaysInYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalPlainYearMonthDaysInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthDaysInYearDesc(yearMonthDaysInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), yearMonthDaysInYearDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), yearMonthDaysInYearDesc); JSGetterSetter yearMonthMonthsInYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalPlainYearMonthMonthsInYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthMonthsInYearDesc(yearMonthMonthsInYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), yearMonthMonthsInYearDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), yearMonthMonthsInYearDesc); JSGetterSetter yearMonthInLeapYearGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalPlainYearMonthInLeapYear, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor yearMonthInLeapYearDesc(yearMonthInLeapYearGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), yearMonthInLeapYearDesc); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), yearMonthInLeapYearDesc); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainYearMonth, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainYearMonth, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainYearMonthPrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalPlainYearMonthPrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainYearMonthPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainYearMonthPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalPlainYearMonthPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEquals()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEquals(), builtinTemporalPlainYearMonthPrototypeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalDurationPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEquals()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEquals(), builtinTemporalPlainYearMonthPrototypeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalPlainYearMonth->setFunctionPrototype(state, temporalPlainYearMonthPrototype); + temporalPlainYearMonth->setFunctionPrototype(state, m_temporalPlainYearMonthPrototype); auto temporalInstant = new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInstant(), builtinTemporalInstantConstructor, 1), NativeFunctionObject::__ForBuiltinConstructor__); temporalInstant->setGlobalIntrinsicObject(state); @@ -2299,71 +2299,71 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalInstant->directDefineOwnProperty(state, ObjectPropertyName(strings->compare), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->compare, builtinTemporalInstantCompare, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - auto temporalInstantPrototype = new PrototypeObject(state); - temporalInstantPrototype->setGlobalIntrinsicObject(state, true); + m_temporalInstantPrototype = new PrototypeObject(state); + m_temporalInstantPrototype->setGlobalIntrinsicObject(state, true); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalInstant, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalInstant, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); JSGetterSetter instantSecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochSeconds(), builtinTemporalInstantPrototypeEpochSeconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor instantSecondsDesc(instantSecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochSeconds()), instantSecondsDesc); + m_temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochSeconds()), instantSecondsDesc); JSGetterSetter instantMillisecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochMilliseconds(), builtinTemporalInstantPrototypeEpochMilliseconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor instantMillisecondsDesc(instantMillisecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMilliseconds()), instantMillisecondsDesc); + m_temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMilliseconds()), instantMillisecondsDesc); JSGetterSetter instantMicrosecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochMicroseconds(), builtinTemporalInstantPrototypeEpochMicroseconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor instantMicrosecondsDesc(instantMicrosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMicroseconds()), instantMicrosecondsDesc); + m_temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochMicroseconds()), instantMicrosecondsDesc); JSGetterSetter instantNanosecondsGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEpochNanoseconds(), builtinTemporalInstantPrototypeEpochNanoseconds, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor instantNanosecondsDesc(instantNanosecondsGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochNanoseconds()), instantNanosecondsDesc); + m_temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEpochNanoseconds()), instantNanosecondsDesc); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEquals()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEquals(), builtinTemporalInstantPrototypeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyEquals()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyEquals(), builtinTemporalInstantPrototypeEquals, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalInstantPrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->add), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->add, builtinTemporalInstantPrototypeAdd, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalInstantPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalInstantPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazySubtract()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazySubtract(), builtinTemporalInstantPrototypeSubtract, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalInstant->setFunctionPrototype(state, temporalInstantPrototype); + temporalInstant->setFunctionPrototype(state, m_temporalInstantPrototype); auto temporalPlainMonthDay = new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyPlainMonthDay(), builtinTemporalPlainMonthDayConstructor, 2), NativeFunctionObject::__ForBuiltinConstructor__); temporalPlainMonthDay->setGlobalIntrinsicObject(state); - auto temporalPlainMonthDayPrototype = new PrototypeObject(state); - temporalPlainMonthDayPrototype->setGlobalIntrinsicObject(state, true); + m_temporalPlainMonthDayPrototype = new PrototypeObject(state); + m_temporalPlainMonthDayPrototype->setGlobalIntrinsicObject(state, true); - temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainMonthDay, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalPlainMonthDay, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); JSGetterSetter monthDayCalendarGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->calendar, builtinTemporalPlainMonthDayPrototypeCalendar, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor monthDayCalendarDesc(monthDayCalendarGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), monthDayCalendarDesc); + m_temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->calendar), monthDayCalendarDesc); JSGetterSetter monthDayMonthCodeGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalPlainMonthDayPrototypeMonthCode, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor monthDayMonthCodeDesc(monthDayMonthCodeGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), monthDayMonthCodeDesc); + m_temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), monthDayMonthCodeDesc); JSGetterSetter monthDayDayGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalPlainMonthDayPrototypeDay, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor monthDayDayDesc(monthDayDayGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), monthDayDayDesc); + m_temporalPlainMonthDayPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), monthDayDayDesc); temporalPlainMonthDay->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalPlainMonthDayFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); @@ -2374,53 +2374,53 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalTimeZone->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalTimeZoneFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - auto temporalTimeZonePrototype = new PrototypeObject(state); - temporalTimeZonePrototype->setGlobalIntrinsicObject(state, true); + m_temporalTimeZonePrototype = new PrototypeObject(state); + m_temporalTimeZonePrototype->setGlobalIntrinsicObject(state, true); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalTimeZone, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalTimeZone, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); JSGetterSetter timeZoneIDGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyId(), builtinTemporalTimeZonePrototypeId, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor timeZoneIDDesc(timeZoneIDGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyId()), timeZoneIDDesc); + m_temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyId()), timeZoneIDDesc); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetOffsetNanosecondsFor()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetOffsetNanosecondsFor(), builtinTemporalTimeZonePrototypeGetOffsetNanosecondsFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetOffsetNanosecondsFor()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetOffsetNanosecondsFor(), builtinTemporalTimeZonePrototypeGetOffsetNanosecondsFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetOffsetStringFor()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetOffsetStringFor(), builtinTemporalTimeZonePrototypeGetOffsetStringFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetOffsetStringFor()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetOffsetStringFor(), builtinTemporalTimeZonePrototypeGetOffsetStringFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetPlainDateTimeFor()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetPlainDateTimeFor(), builtinTemporalTimeZonePrototypeGetPlainDateTimeFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetPlainDateTimeFor()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetPlainDateTimeFor(), builtinTemporalTimeZonePrototypeGetPlainDateTimeFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetPossibleInstantsFor()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetPossibleInstantsFor(), builtinTemporalTimeZonePrototypeGetPossibleInstantsFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetPossibleInstantsFor()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetPossibleInstantsFor(), builtinTemporalTimeZonePrototypeGetPossibleInstantsFor, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetNextTransition()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetNextTransition(), builtinTemporalTimeZonePrototypeGetNextTransition, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetNextTransition()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetNextTransition(), builtinTemporalTimeZonePrototypeGetNextTransition, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetPreviousTransition()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetPreviousTransition(), builtinTemporalTimeZonePrototypeGetPreviousTransition, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalTimeZonePrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyGetPreviousTransition()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyGetPreviousTransition(), builtinTemporalTimeZonePrototypeGetPreviousTransition, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalTimeZone->setFunctionPrototype(state, temporalTimeZonePrototype); + temporalTimeZone->setFunctionPrototype(state, m_temporalTimeZonePrototype); auto temporalCalendar = new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyCalendar(), builtinTemporalCalendarConstructor, 1), NativeFunctionObject::__ForBuiltinConstructor__); temporalCalendar->setGlobalIntrinsicObject(state); - auto temporalCalendarPrototype = new PrototypeObject(state); - temporalCalendarPrototype->setGlobalIntrinsicObject(state, true); + m_temporalCalendarPrototype = new PrototypeObject(state); + m_temporalCalendarPrototype->setGlobalIntrinsicObject(state, true); JSGetterSetter calendarIDGS( new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyId(), builtinTemporalCalendarPrototypeId, 0, NativeFunctionInfo::Strict)), Value(Value::EmptyValue)); ObjectPropertyDescriptor calendarIDDesc(calendarIDGS, ObjectPropertyDescriptor::ConfigurablePresent); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyId()), calendarIDDesc); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyId()), calendarIDDesc); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalCalendar, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->constructor), ObjectPropertyDescriptor(temporalCalendar, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendar->setFunctionPrototype(state, temporalCalendarPrototype); + temporalCalendar->setFunctionPrototype(state, m_temporalCalendarPrototype); temporalNow->directDefineOwnProperty(state, ObjectPropertyName(state.context()->vmInstance()->globalSymbols().toStringTag), ObjectPropertyDescriptor(strings->lazyTemporalDotNow().string(), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::ConfigurablePresent))); @@ -2443,59 +2443,59 @@ void GlobalObject::installTemporal(ExecutionState& state) temporalCalendar->directDefineOwnProperty(state, ObjectPropertyName(strings->from), ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->from, builtinTemporalCalendarFrom, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDateFromFields()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDateFromFields(), builtinTemporalCalendarPrototypeDateFromFields, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDateFromFields()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDateFromFields(), builtinTemporalCalendarPrototypeDateFromFields, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYear(), builtinTemporalCalendarPrototypeYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyYear(), builtinTemporalCalendarPrototypeYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonth(), builtinTemporalCalendarPrototypeMonth, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonth()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonth(), builtinTemporalCalendarPrototypeMonth, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalCalendarPrototypeMonthCode, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthCode()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthCode(), builtinTemporalCalendarPrototypeMonthCode, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalCalendarPrototypeDay, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDay()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDay(), builtinTemporalCalendarPrototypeDay, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalCalendarPrototypeDayOfWeek, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfWeek()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfWeek(), builtinTemporalCalendarPrototypeDayOfWeek, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalCalendarPrototypeDayOfYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDayOfYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDayOfYear(), builtinTemporalCalendarPrototypeDayOfYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalCalendarPrototypeWeekOfYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyWeekOfYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyWeekOfYear(), builtinTemporalCalendarPrototypeWeekOfYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalCalendarPrototypeDaysInWeek, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInWeek()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInWeek(), builtinTemporalCalendarPrototypeDaysInWeek, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalCalendarPrototypeDaysInMonth, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInMonth()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInMonth(), builtinTemporalCalendarPrototypeDaysInMonth, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalCalendarPrototypeDaysInYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyDaysInYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyDaysInYear(), builtinTemporalCalendarPrototypeDaysInYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalCalendarPrototypeMonthsInYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMonthsInYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMonthsInYear(), builtinTemporalCalendarPrototypeMonthsInYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalCalendarInLeapYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyInLeapYear()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyInLeapYear(), builtinTemporalCalendarInLeapYear, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMergeFields()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMergeFields(), builtinTemporalCalendarPrototypeMergeFields, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyMergeFields()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyMergeFields(), builtinTemporalCalendarPrototypeMergeFields, 2, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyFields()), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyFields(), builtinTemporalCalendarFields, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->lazyFields()), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->lazyFields(), builtinTemporalCalendarFields, 1, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->toString), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->toString, builtinTemporalCalendarToString, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->toString), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->toString, builtinTemporalCalendarToString, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->toJSON), - ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->toJSON, builtinTemporalCalendarToJSON, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); + m_temporalCalendarPrototype->directDefineOwnProperty(state, ObjectPropertyName(strings->toJSON), + ObjectPropertyDescriptor(new NativeFunctionObject(state, NativeFunctionInfo(strings->toJSON, builtinTemporalCalendarToJSON, 0, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent))); - m_temporal = new Temporal(state, temporalCalendar, temporalCalendarPrototype, temporalDurationPrototype, temporalPlainDatePrototype, temporalPlainTimePrototype, temporalPlainDateTimePrototype, temporalPlainYearMonthPrototype, temporalInstantPrototype, temporalPlainMonthDayPrototype, temporalTimeZonePrototype, temporalZonedDateTimePrototype); + m_temporal = new TemporalObject(state); m_temporal->setGlobalIntrinsicObject(state); m_temporal->directDefineOwnProperty(state, ObjectPropertyName(state.context()->vmInstance()->globalSymbols().toStringTag), diff --git a/src/runtime/GlobalObject.h b/src/runtime/GlobalObject.h index 00bb64b9f..0e8d7dd64 100644 --- a/src/runtime/GlobalObject.h +++ b/src/runtime/GlobalObject.h @@ -240,8 +240,24 @@ class FunctionObject; #define GLOBALOBJECT_BUILTIN_FINALIZATIONREGISTRY(F, objName) \ F(finalizationRegistry, FunctionObject, objName) \ F(finalizationRegistryPrototype, Object, objName) -#define GLOBALOBJECT_BUILTIN_TEMPORAL(F, objName) \ - F(temporal, Object, objName) + +#if defined(ENABLE_TEMPORAL) +#define GLOBALOBJECT_BUILTIN_TEMPORAL(F, objName) \ + F(temporal, Object, objName) \ + F(temporalCalendarPrototype, Object, objName) \ + F(temporalDurationPrototype, Object, objName) \ + F(temporalInstantPrototype, Object, objName) \ + F(temporalPlainDatePrototype, Object, objName) \ + F(temporalPlainDateTimePrototype, Object, objName) \ + F(temporalPlainMonthDayPrototype, Object, objName) \ + F(temporalPlainTimePrototype, Object, objName) \ + F(temporalPlainYearMonthPrototype, Object, objName) \ + F(temporalTimeZonePrototype, Object, objName) \ + F(temporalZonedDateTimePrototype, Object, objName) +#else +#define GLOBALOBJECT_BUILTIN_TEMPORAL(F, objName) +#endif + #define GLOBALOBJECT_BUILTIN_ITERATOR(F, objName) \ F(iterator, FunctionObject, objName) \ F(wrapForValidIteratorPrototype, Object, objName) \ diff --git a/src/runtime/Temporal.h b/src/runtime/Temporal.h deleted file mode 100644 index c1080107f..000000000 --- a/src/runtime/Temporal.h +++ /dev/null @@ -1,231 +0,0 @@ -#if defined(ENABLE_TEMPORAL) -/* - * Copyright (c) 2022-present Samsung Electronics Co., Ltd - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - * USA - */ - -#ifndef __EscargotTemporal__ -#define __EscargotTemporal__ - -#include "Escargot.h" -#include "intl/Intl.h" -#include "runtime/VMInstance.h" - -namespace Escargot { - -class Temporal : public DerivedObject { -public: - explicit Temporal(ExecutionState& state, Object* proto) - : DerivedObject(state, proto, ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER) - { - } - - Temporal(ExecutionState& state, Object* temporalCalendar, Object* temporalCalendarPrototype, Object* temporalDurationPrototype, Object* temporalPlainDatePrototype, Object* temporalPlainTimePrototype, Object* temporalPlainDateTimePrototype, Object* temporalPlainYearMonthPrototype, Object* temporalInstantPrototype, Object* temporalPlainMonthDayPrototype, Object* temporalTimeZonePrototype, Object* temporalZonedDateTimePrototype) - : DerivedObject(state) - , m_temporalCalendar(temporalCalendar) - , m_temporalCalendarPrototype(temporalCalendarPrototype) - , m_temporalDurationPrototype(temporalDurationPrototype) - , m_temporalPlainDatePrototype(temporalPlainDatePrototype) - , m_temporalPlainTimePrototype(temporalPlainTimePrototype) - , m_temporalPlainDateTimePrototype(temporalPlainDateTimePrototype) - , m_temporalPlainYearMonthPrototype(temporalPlainYearMonthPrototype) - , m_temporalInstantPrototype(temporalInstantPrototype) - , m_temporalPlainMonthDayPrototype(temporalPlainMonthDayPrototype) - , m_temporalTimeZonePrototype(temporalTimeZonePrototype) - , m_temporalZonedDateTimePrototype(temporalZonedDateTimePrototype) - { - } - - Object* getTemporalCalendar() const - { - return m_temporalCalendar; - } - - Object* getTemporalCalendarPrototype() const - { - return m_temporalCalendarPrototype; - } - - Object* getTemporalDurationPrototype() const - { - return m_temporalDurationPrototype; - } - - Object* getTemporalPlainDatePrototype() const - { - return m_temporalPlainDatePrototype; - } - - Object* getTemporalPlainTimePrototype() const - { - return m_temporalPlainTimePrototype; - } - - Object* getTemporalPlainDateTimePrototype() const - { - return m_temporalPlainDateTimePrototype; - } - Object* getTemporalPlainMonthDayPrototype() const - { - return m_temporalPlainMonthDayPrototype; - } - - Object* getTemporalPlainYearMonthPrototype() const - { - return m_temporalPlainYearMonthPrototype; - } - - Object* getTemporalInstantPrototype() const - { - return m_temporalInstantPrototype; - } - Object* getTemporalTimeZonePrototype() const - { - return m_temporalTimeZonePrototype; - } - - Object* getTemporalZonedDateTimePrototype() const - { - return m_temporalZonedDateTimePrototype; - } - - bool isTemporalObject() const override - { - return true; - } - - static Value getOptionsObject(ExecutionState& state, const Value& options) - { - if (options.isObject()) { - return options; - } - - if (!options.isUndefined()) { - ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, "options must be object"); - } - - return {}; - } - - static Value toTemporalOverflow(ExecutionState& state, const Value& normalizedOptions) - { - if (normalizedOptions.isUndefined()) { - return state.context()->staticStrings().lazyConstrain().string(); - } - auto options = normalizedOptions.toObject(state); - Value matcherValues[2] = { state.context()->staticStrings().lazyConstrain().string(), state.context()->staticStrings().reject.string() }; - return Intl::getOption(state, options, state.context()->staticStrings().lazyOverflow().string(), Intl::StringValue, matcherValues, 2, matcherValues[0]); - } - - static Value toTemporalDisambiguation(ExecutionState& state, const Value& options) - { - if (options.isUndefined()) { - return state.context()->staticStrings().lazyConstrain().string(); - } - - Value matcherValues[4] = { state.context()->staticStrings().lazyConstrain().string(), state.context()->staticStrings().lazyEarlier().string(), state.context()->staticStrings().lazyLater().string(), state.context()->staticStrings().reject.string() }; - return Intl::getOption(state, options.asObject(), state.context()->staticStrings().lazyDisambiguation().string(), Intl::StringValue, matcherValues, 4, matcherValues[0]); - } - - static Value toTemporalOffset(ExecutionState& state, const Value& options, const Value& fallback) - { - if (options.isUndefined()) { - return fallback; - } - - Value matcherValues[4] = { state.context()->staticStrings().lazyPrefer().string(), state.context()->staticStrings().lazyUse().string(), state.context()->staticStrings().lazyIgnore().string(), state.context()->staticStrings().reject.string() }; - return Intl::getOption(state, options.asObject(), state.context()->staticStrings().lazyOffset().string(), Intl::StringValue, matcherValues, 4, fallback); - } - - static Value prepareTemporalFields(ExecutionState& state, const Value& fields, const ValueVector& fieldNames, const ValueVector& requiredFields) - { - ASSERT(fields.isObject()); - auto* result = new Object(state); - for (auto& property : fieldNames) { - Value value = fields.asObject()->get(state, ObjectPropertyName(state, property.asString())).value(state, value); - String* prop = property.asString(); - - if (value.isUndefined()) { - if (std::find(requiredFields.begin(), requiredFields.end(), property) != requiredFields.end()) { - ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("requiredFields contains property")); - } - - if (prop->equals("year") || prop->equals("month") || prop->equals("monthCode") || prop->equals("day") || prop->equals("offset") || prop->equals("era") || prop->equals("eraYear") || prop->equals("timeZone")) { - value = Value(); - } else { - value = Value(0); - } - } else { - if (!prop->equals("timeZone")) { - if (prop->equals("monthCode") || prop->equals("offset") || prop->equals("era")) { - value = Value(value.toString(state)); - } else if (prop->equals("month") || prop->equals("day")) { - value = Value(value.toUint32(state)); - } else { - value = Value(Value::DoubleToIntConvertibleTestNeeds, value.toInteger(state)); - } - } - } - result->defineOwnProperty(state, ObjectPropertyName(AtomicString(state, property.asString())), ObjectPropertyDescriptor(value, ObjectPropertyDescriptor::AllPresent)); - } - return Value(result); - } - - static void rejectObjectWithCalendarOrTimeZone(ExecutionState& state, const Value& object) - { - ASSERT(object.isObject()); - - if (object.asObject()->isTemporalPlainDateObject() || object.asObject()->isTemporalPlainDateTimeObject() || object.asObject()->isTemporalPlainTimeObject() || object.asObject()->isTemporalZonedDateTimeObject() || object.asObject()->isTemporalPlainYearMonthObject() || object.asObject()->isTemporalMonthDayObject()) { - ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("Invalid type of Object")); - } - - if (!object.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().calendar.string())).value(state, object).isUndefined()) { - ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("Object has calendar property")); - } - - if (!object.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().lazyTimeZone().string())).value(state, object).isUndefined()) { - ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("Object has timezone property")); - } - } - -private: - enum PropertyName { - DISAMBIGUATION - }; - - enum OptionType { - STRING, - BOOL, - NUMBER - }; - Object* m_temporalCalendar; - Object* m_temporalCalendarPrototype; - Object* m_temporalDurationPrototype; - Object* m_temporalPlainDatePrototype; - Object* m_temporalPlainTimePrototype; - Object* m_temporalPlainDateTimePrototype; - Object* m_temporalPlainYearMonthPrototype; - Object* m_temporalInstantPrototype; - Object* m_temporalPlainMonthDayPrototype; - Object* m_temporalTimeZonePrototype; - Object* m_temporalZonedDateTimePrototype; -}; - -} // namespace Escargot - -#endif -#endif diff --git a/src/runtime/TemporalObject.cpp b/src/runtime/TemporalObject.cpp index 67b34460e..e650f622a 100644 --- a/src/runtime/TemporalObject.cpp +++ b/src/runtime/TemporalObject.cpp @@ -30,7 +30,7 @@ TemporalObject::TemporalObject(ExecutionState& state) } TemporalObject::TemporalObject(ExecutionState& state, Object* proto) - : Temporal(state, proto) + : DerivedObject(state, proto) { } @@ -68,29 +68,29 @@ Value TemporalObject::toISOTime(ExecutionState& state, DateObject& d) } -String* TemporalObject::dateTimeUnitString(ExecutionState& state, DateTimeUnits unit) +static String* dateTimeUnitString(ExecutionState& state, TemporalObject::DateTimeUnits unit) { StaticStrings& strings = state.context()->staticStrings(); switch (unit) { - case YEAR_UNIT: + case TemporalObject::YEAR_UNIT: return strings.lazyYear().string(); - case MONTH_UNIT: + case TemporalObject::MONTH_UNIT: return strings.lazyMonth().string(); - case WEEK_UNIT: + case TemporalObject::WEEK_UNIT: return strings.lazyWeek().string(); - case DAY_UNIT: + case TemporalObject::DAY_UNIT: return strings.lazyDay().string(); - case HOUR_UNIT: + case TemporalObject::HOUR_UNIT: return strings.lazyHour().string(); - case MINUTE_UNIT: + case TemporalObject::MINUTE_UNIT: return strings.lazyMinute().string(); - case SECOND_UNIT: + case TemporalObject::SECOND_UNIT: return strings.lazySecond().string(); - case MILLISECOND_UNIT: + case TemporalObject::MILLISECOND_UNIT: return strings.lazyMillisecond().string(); - case MICROSECOND_UNIT: + case TemporalObject::MICROSECOND_UNIT: return strings.lazyMicrosecond().string(); - case NANOSECOND_UNIT: + case TemporalObject::NANOSECOND_UNIT: return strings.lazyNanosecond().string(); default: return String::emptyString; @@ -99,11 +99,16 @@ String* TemporalObject::dateTimeUnitString(ExecutionState& state, DateTimeUnits return String::emptyString; } -std::string TemporalObject::getNNumberFromString(ExecutionState& state, std::string& isoString, const int n, unsigned int& index) +static bool temporalIsNumber(const std::string& s) +{ + return !s.empty() && std::find_if(s.begin(), s.end(), [](unsigned char c) { return !std::isdigit(c); }) == s.end(); +} + +static std::string getNNumberFromString(ExecutionState& state, std::string& isoString, const int n, unsigned int& index) { std::string retVal; - if (!TemporalObject::isNumber(isoString.substr(index, n))) { + if (!temporalIsNumber(isoString.substr(index, n))) { ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, "Invalid ISO string"); } @@ -112,7 +117,7 @@ std::string TemporalObject::getNNumberFromString(ExecutionState& state, std::str return retVal; } -std::map TemporalObject::getSeconds(ExecutionState& state, std::string& isoString, unsigned int& index) +static std::map temporalGetSeconds(ExecutionState& state, std::string& isoString, unsigned int& index) { int counter = index + 1; while (std::isdigit(isoString[counter++])) @@ -131,9 +136,9 @@ std::map TemporalObject::getSeconds(Executio tmp += '0'; } - return { { MILLISECOND_UNIT, std::stoi(tmp.substr(0, 3)) }, - { MICROSECOND_UNIT, std::stoi(tmp.substr(3, 3)) }, - { NANOSECOND_UNIT, std::stoi(tmp.substr(6, 3)) } }; + return { { TemporalObject::MILLISECOND_UNIT, std::stoi(tmp.substr(0, 3)) }, + { TemporalObject::MICROSECOND_UNIT, std::stoi(tmp.substr(3, 3)) }, + { TemporalObject::NANOSECOND_UNIT, std::stoi(tmp.substr(6, 3)) } }; } std::string TemporalObject::offset(ExecutionState& state, std::string& isoString, unsigned int& index) @@ -187,7 +192,7 @@ std::string TemporalObject::offset(ExecutionState& state, std::string& isoString return ""; } unsigned int start = index; - TemporalObject::getSeconds(state, isoString, index); + temporalGetSeconds(state, isoString, index); result += isoString.substr(start, index - start + 1); for (unsigned int i = 0; i < 9 - (index - start); i++) { result += '0'; @@ -201,7 +206,7 @@ std::string TemporalObject::offset(ExecutionState& state, std::string& isoString return result; } -std::string TemporalObject::tzComponent(ExecutionState& state, std::string& isoString, unsigned int& index) +static std::string temporalTZComponent(ExecutionState& state, std::string& isoString, unsigned int& index) { std::string timeZoneID; unsigned int i = 0; @@ -233,13 +238,66 @@ std::string TemporalObject::tzComponent(ExecutionState& state, std::string& isoS return timeZoneID; } -TemporalObject::DateTime TemporalObject::parseValidIso8601String(ExecutionState& state, std::string isoString, const bool parseTimeZone = false) +static TemporalObject::TimeZone parseTimeZoneOffset(ExecutionState& state, std::string& isoString, unsigned int& index) +{ + // Offset + auto tz = TemporalObject::TimeZone(false, String::emptyString, String::emptyString); + + if (isoString[index] == 'z' || isoString[index] == 'Z') { + tz.z = true; + ++index; + } else if (isoString[index] == '+' || isoString[index] == '-' || isoString.rfind("−", index) == index) { + tz.offsetString = new ASCIIString(TemporalObject::offset(state, isoString, index).c_str()); + + if (tz.offsetString->length() == 0) { + return TemporalObject::TimeZone{ false, nullptr, nullptr }; + } + } + + // TimeZone + if (isoString[index] == '[' && isoString.rfind("[u-ca=", index) != index) { + std::string tmp = temporalTZComponent(state, isoString, index); + while (tmp.length() != 0) { + tz.name = new ASCIIString(std::string(tz.name->toNonGCUTF8StringData()).append(tmp).c_str()); + + if (isoString[index] == '/') { + tmp = temporalTZComponent(state, isoString, index); + } + + if (isoString[index] == ']') { + tz.name = new ASCIIString(std::string(tz.name->toNonGCUTF8StringData()).append("/" + tmp).c_str()); + index++; + break; + } + } + } else if (isoString.rfind("Etc/GMT", index) == 0) { + index += 7; + + if (isoString[index] == '+' || isoString[index] == '-') { + if (!std::isdigit(isoString[index + 1])) { + return TemporalObject::TimeZone{ false, nullptr, nullptr }; + } + + if (temporalIsNumber(isoString.substr(index + 1, 2))) { + index += 3; + } + + index += 2; + } + } else if (isoString[index] == '+' || isoString[index] == '-' || (index < isoString.length() && isoString.rfind("−", index) == 0)) { + TemporalObject::offset(state, isoString, index); + } + + return tz; +} + +static TemporalObject::DateTime parseValidIso8601String(ExecutionState& state, std::string isoString, const bool parseTimeZone = false) { if (isoString.empty()) { ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, "Invalid ISO string"); } - DateTime dateTime = { 0, 1, 1, 0, 0, 0, 0, 0, 0, String::emptyString, new TimeZone(false, String::emptyString, String::emptyString) }; + TemporalObject::DateTime dateTime = { 0, 1, 1, 0, 0, 0, 0, 0, 0, String::emptyString, new TemporalObject::TimeZone(false, String::emptyString, String::emptyString) }; unsigned int index = 0; @@ -248,10 +306,10 @@ TemporalObject::DateTime TemporalObject::parseValidIso8601String(ExecutionState& if (isoString.at(index) != 'T' && isoString.find('-') != std::string::npos) { // Date bool monthDay = false; - if (isoString.rfind("−", index) == 0 && TemporalObject::isNumber(isoString.substr(3 + index, 4))) { + if (isoString.rfind("−", index) == 0 && temporalIsNumber(isoString.substr(3 + index, 4))) { dateTime.year = std::stoi("-" + isoString.substr(3 + index, 4)); index += 7; - } else if (TemporalObject::isNumber(isoString.substr(index, 4))) { + } else if (temporalIsNumber(isoString.substr(index, 4))) { dateTime.year = std::stoi(isoString.substr(0, 4)); index += 4; } else if (isoString.rfind("--", 0) == 0) { @@ -302,36 +360,36 @@ TemporalObject::DateTime TemporalObject::parseValidIso8601String(ExecutionState& ; } if (isoString.find(':') != std::string::npos) { - dateTime.hour = std::stoi(TemporalObject::getNNumberFromString(state, isoString, 2, index)); + dateTime.hour = std::stoi(getNNumberFromString(state, isoString, 2, index)); if (isoString.at(index) == ':') { ++index; } - dateTime.minute = std::stoi(TemporalObject::getNNumberFromString(state, isoString, 2, index)); + dateTime.minute = std::stoi(getNNumberFromString(state, isoString, 2, index)); if (isoString.at(index) == ':') { ++index; - dateTime.second = std::stoi(TemporalObject::getNNumberFromString(state, isoString, 2, index)); + dateTime.second = std::stoi(getNNumberFromString(state, isoString, 2, index)); } - if (TemporalObject::isNumber(isoString.substr(index, 2))) { - dateTime.second = std::stoi(TemporalObject::getNNumberFromString(state, isoString, 2, index)); + if (temporalIsNumber(isoString.substr(index, 2))) { + dateTime.second = std::stoi(getNNumberFromString(state, isoString, 2, index)); } if (isoString.at(index) == '.' || isoString.at(index) == ',') { std::map seconds; - seconds = TemporalObject::getSeconds(state, isoString, index); - dateTime.millisecond = seconds[MILLISECOND_UNIT]; - dateTime.microsecond = seconds[MICROSECOND_UNIT]; - dateTime.nanosecond = seconds[NANOSECOND_UNIT]; + seconds = temporalGetSeconds(state, isoString, index); + dateTime.millisecond = seconds[TemporalObject::MILLISECOND_UNIT]; + dateTime.microsecond = seconds[TemporalObject::MICROSECOND_UNIT]; + dateTime.nanosecond = seconds[TemporalObject::NANOSECOND_UNIT]; } } - auto timeZoneOffset = TemporalObject::parseTimeZoneOffset(state, isoString, index); + auto timeZoneOffset = parseTimeZoneOffset(state, isoString, index); if (parseTimeZone && timeZoneOffset.offsetString && timeZoneOffset.name) { - dateTime.tz = new TimeZone{ timeZoneOffset.z, timeZoneOffset.offsetString, timeZoneOffset.name }; + dateTime.tz = new TemporalObject::TimeZone{ timeZoneOffset.z, timeZoneOffset.offsetString, timeZoneOffset.name }; } else if (!(timeZoneOffset.offsetString && timeZoneOffset.name)) { ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, "Invalid ISO string"); } @@ -394,20 +452,20 @@ TemporalObject::DateTime TemporalObject::parseValidIso8601String(ExecutionState& return dateTime; } -TemporalObject::DateTime TemporalObject::parseTemporalDateString(ExecutionState& state, const std::string& isoString) -{ - return TemporalObject::parseTemporalDateTimeString(state, isoString); -} - -TemporalObject::DateTime TemporalObject::parseTemporalDateTimeString(ExecutionState& state, const std::string& isoString) +static TemporalObject::DateTime parseTemporalDateTimeString(ExecutionState& state, const std::string& isoString) { if (isoString.find('z') != std::string::npos || isoString.find('Z') != std::string::npos) { ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, "isoString contains UTCDesignator"); } - return TemporalObject::parseValidIso8601String(state, isoString); + return parseValidIso8601String(state, isoString); +} + +static TemporalObject::DateTime parseTemporalDateString(ExecutionState& state, const std::string& isoString) +{ + return parseTemporalDateTimeString(state, isoString); } -std::map TemporalObject::parseTemporalDurationString(ExecutionState& state, const std::string& isoString) +static std::map parseTemporalDurationString(ExecutionState& state, const std::string& isoString) { int sign = 1; unsigned int index = 0; @@ -560,12 +618,12 @@ std::map TemporalObject::parseTemporalDurati return TemporalDurationObject::createDurationRecord(state, years * sign, months * sign, weeks * sign, days * sign, hours * sign, std::floor(minutesMV) * sign, std::floor(secondsMV) * sign, std::floor(milliSecondsMV) * sign, std::floor(microSecondsMV) * sign, std::floor(nanoSecondsMV) * sign); } -TemporalObject::DateTime TemporalObject::parseTemporalYearMonthString(ExecutionState& state, const std::string& isoString) +static TemporalObject::DateTime parseTemporalYearMonthString(ExecutionState& state, const std::string& isoString) { - return TemporalObject::parseTemporalDateTimeString(state, isoString); + return parseTemporalDateTimeString(state, isoString); } -TemporalObject::DateTime TemporalObject::parseTemporalInstantString(ExecutionState& state, const std::string& isoString) +static TemporalObject::DateTime parseTemporalInstantString(ExecutionState& state, const std::string& isoString) { auto result = parseValidIso8601String(state, isoString, true); @@ -580,9 +638,9 @@ TemporalObject::DateTime TemporalObject::parseTemporalInstantString(ExecutionSta return result; } -TemporalObject::TimeZone TemporalObject::parseTemporalTimeZoneString(ExecutionState& state, const std::string& isoString) +static TemporalObject::TimeZone parseTemporalTimeZoneString(ExecutionState& state, const std::string& isoString) { - auto result = TimeZone(false, String::emptyString, String::emptyString); + auto result = TemporalObject::TimeZone(false, String::emptyString, String::emptyString); if (isoString == "UTC") { result.z = true; @@ -594,10 +652,10 @@ TemporalObject::TimeZone TemporalObject::parseTemporalTimeZoneString(ExecutionSt } unsigned int index = 0; - result = TemporalObject::parseTimeZoneOffset(state, const_cast(isoString), index); + result = parseTimeZoneOffset(state, const_cast(isoString), index); if (!(result.offsetString && result.name) || (result.offsetString->length() == 0 && result.name->length() == 0 && !result.z)) { - result = *TemporalObject::parseValidIso8601String(state, isoString, true).tz; + result = *parseValidIso8601String(state, isoString, true).tz; } if (result.z) { @@ -611,67 +669,48 @@ TemporalObject::TimeZone TemporalObject::parseTemporalTimeZoneString(ExecutionSt return result; } -TemporalObject::TimeZone TemporalObject::parseTimeZoneOffset(ExecutionState& state, std::string& isoString, unsigned int& index) +static TemporalObject::DateTime parseTemporalZonedDateTimeString(ExecutionState& state, const std::string& isoString) { - // Offset - auto tz = TimeZone(false, String::emptyString, String::emptyString); - - if (isoString[index] == 'z' || isoString[index] == 'Z') { - tz.z = true; - ++index; - } else if (isoString[index] == '+' || isoString[index] == '-' || isoString.rfind("−", index) == index) { - tz.offsetString = new ASCIIString(TemporalObject::offset(state, isoString, index).c_str()); - - if (tz.offsetString->length() == 0) { - return TemporalObject::TimeZone{ false, nullptr, nullptr }; - } - } - - // TimeZone - if (isoString[index] == '[' && isoString.rfind("[u-ca=", index) != index) { - std::string tmp = TemporalObject::tzComponent(state, isoString, index); - while (tmp.length() != 0) { - tz.name = new ASCIIString(std::string(tz.name->toNonGCUTF8StringData()).append(tmp).c_str()); + return parseValidIso8601String(state, isoString, true); +} - if (isoString[index] == '/') { - tmp = TemporalObject::tzComponent(state, isoString, index); - } +static TemporalObject::DateTime parseTemporalMonthDayString(ExecutionState& state, const std::string& isoString) +{ + return parseTemporalDateTimeString(state, isoString); +} - if (isoString[index] == ']') { - tz.name = new ASCIIString(std::string(tz.name->toNonGCUTF8StringData()).append("/" + tmp).c_str()); - index++; - break; +static Value prepareTemporalFields(ExecutionState& state, const Value& fields, const ValueVector& fieldNames, const ValueVector& requiredFields) +{ + ASSERT(fields.isObject()); + auto* result = new Object(state); + for (auto& property : fieldNames) { + Value value = fields.asObject()->get(state, ObjectPropertyName(state, property.asString())).value(state, value); + String* prop = property.asString(); + + if (value.isUndefined()) { + if (std::find(requiredFields.begin(), requiredFields.end(), property) != requiredFields.end()) { + ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("requiredFields contains property")); } - } - } else if (isoString.rfind("Etc/GMT", index) == 0) { - index += 7; - if (isoString[index] == '+' || isoString[index] == '-') { - if (!std::isdigit(isoString[index + 1])) { - return TemporalObject::TimeZone{ false, nullptr, nullptr }; + if (prop->equals("year") || prop->equals("month") || prop->equals("monthCode") || prop->equals("day") || prop->equals("offset") || prop->equals("era") || prop->equals("eraYear") || prop->equals("timeZone")) { + value = Value(); + } else { + value = Value(0); } - - if (isNumber(isoString.substr(index + 1, 2))) { - index += 3; + } else { + if (!prop->equals("timeZone")) { + if (prop->equals("monthCode") || prop->equals("offset") || prop->equals("era")) { + value = Value(value.toString(state)); + } else if (prop->equals("month") || prop->equals("day")) { + value = Value(value.toUint32(state)); + } else { + value = Value(Value::DoubleToIntConvertibleTestNeeds, value.toInteger(state)); + } } - - index += 2; } - } else if (isoString[index] == '+' || isoString[index] == '-' || (index < isoString.length() && isoString.rfind("−", index) == 0)) { - TemporalObject::offset(state, isoString, index); + result->defineOwnProperty(state, ObjectPropertyName(AtomicString(state, property.asString())), ObjectPropertyDescriptor(value, ObjectPropertyDescriptor::AllPresent)); } - - return tz; -} - -TemporalObject::DateTime TemporalObject::parseTemporalZonedDateTimeString(ExecutionState& state, const std::string& isoString) -{ - return TemporalObject::parseValidIso8601String(state, isoString, true); -} - -TemporalObject::DateTime TemporalObject::parseTemporalMonthDayString(ExecutionState& state, const std::string& isoString) -{ - return parseTemporalDateTimeString(state, isoString); + return Value(result); } TemporalPlainTimeObject::TemporalPlainTimeObject(ExecutionState& state, Object* proto, const TemporalTime& time, TemporalCalendarObject* calendar) @@ -681,7 +720,7 @@ TemporalPlainTimeObject::TemporalPlainTimeObject(ExecutionState& state, Object* { } -Value TemporalObject::toRelativeTemporalObject(ExecutionState& state, Object* options) +static Value toRelativeTemporalObject(ExecutionState& state, Object* options) { auto value = options->get(state, ObjectPropertyName(state.context()->staticStrings().lazyRelativeTo())).value(state, options); @@ -722,7 +761,7 @@ Value TemporalObject::toRelativeTemporalObject(ExecutionState& state, Object* op Value(state.context()->staticStrings().lazySecond().string()), Value(state.context()->staticStrings().lazyYear().string()) }; ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, calendar, values); - Value fields = Temporal::prepareTemporalFields(state, value, fieldNames, ValueVector()); + Value fields = prepareTemporalFields(state, value, fieldNames, ValueVector()); result = TemporalPlainDateTimeObject::interpretTemporalDateTimeFields(state, calendar, fields, options); offsetString = valueObject->get(state, ObjectPropertyName(state.context()->staticStrings().lazyOffset())).value(state, value); @@ -736,7 +775,7 @@ Value TemporalObject::toRelativeTemporalObject(ExecutionState& state, Object* op offsetBehaviour = TemporalZonedDateTimeObject::WALL; } } else { - auto parseResult = TemporalObject::parseTemporalZonedDateTimeString(state, value.asString()->toNonGCUTF8StringData()); + auto parseResult = parseTemporalZonedDateTimeString(state, value.asString()->toNonGCUTF8StringData()); calendar = TemporalCalendarObject::toTemporalCalendarWithISODefault(state, Value((parseResult.calendar))); if (parseResult.tz->name->length() != 0) { @@ -782,7 +821,7 @@ Value TemporalObject::toRelativeTemporalObject(ExecutionState& state, Object* op return TemporalPlainDateObject::createTemporalDate(state, result[TemporalObject::YEAR_UNIT], result[TemporalObject::MONTH_UNIT], result[TemporalObject::DAY_UNIT], calendar); } -Object* TemporalObject::mergeLargestUnitOption(ExecutionState& state, const Value& option, TemporalObject::DateTimeUnits largestUnit) +static Object* mergeLargestUnitOption(ExecutionState& state, const Value& option, TemporalObject::DateTimeUnits largestUnit) { auto merged = new Object(state, Object::PrototypeIsNull); @@ -796,17 +835,7 @@ Object* TemporalObject::mergeLargestUnitOption(ExecutionState& state, const Valu return merged; } -// The rounding modes accepted by this abstract operation are intended to be the same as whatever is eventually standardized in the Intl.NumberFormat V3 proposal. -BigInt* TemporalObject::roundNumberToIncrementAsIfPositive(ExecutionState& state, BigInt* x, int64_t increment, RoundingMode roundingMode) -{ - BigInt* quotient = x->division(state, new BigInt(increment)); - UnsignedRoundingMode unsignedRoundingMode = TemporalObject::getUnsignedRoundingMode(state, roundingMode, false); - BigInt* r1 = quotient->addition(state, new BigInt((int64_t)0)); - BigInt* r2 = quotient->addition(state, new BigInt((int64_t)1)); - return TemporalObject::applyUnsignedRoundingMode(state, quotient, r1, r2, unsignedRoundingMode)->multiply(state, new BigInt(increment)); -} - -UnsignedRoundingMode TemporalObject::getUnsignedRoundingMode(ExecutionState& state, RoundingMode roundingMode, bool isNegative) +static UnsignedRoundingMode getUnsignedRoundingMode(ExecutionState& state, RoundingMode roundingMode, bool isNegative) { if (roundingMode == RoundingMode::HALF_EVEN) { return UNSIGNED_HALF_EVEN; @@ -819,7 +848,7 @@ UnsignedRoundingMode TemporalObject::getUnsignedRoundingMode(ExecutionState& sta return positiveUnsignedRoundingMode[roundingMode]; } -BigInt* TemporalObject::applyUnsignedRoundingMode(ExecutionState& state, BigInt* x, BigInt* r1, BigInt* r2, UnsignedRoundingMode unsignedRoundingMode) +BigInt* applyUnsignedRoundingMode(ExecutionState& state, BigInt* x, BigInt* r1, BigInt* r2, UnsignedRoundingMode unsignedRoundingMode) { if (x->equals(r1)) { return r1; @@ -867,22 +896,32 @@ BigInt* TemporalObject::applyUnsignedRoundingMode(ExecutionState& state, BigInt* return r2; } -int64_t TemporalObject::floor(double num) +// The rounding modes accepted by this abstract operation are intended to be the same as whatever is eventually standardized in the Intl.NumberFormat V3 proposal. +static BigInt* roundNumberToIncrementAsIfPositive(ExecutionState& state, BigInt* x, int64_t increment, RoundingMode roundingMode) +{ + BigInt* quotient = x->division(state, new BigInt(increment)); + UnsignedRoundingMode unsignedRoundingMode = getUnsignedRoundingMode(state, roundingMode, false); + BigInt* r1 = quotient->addition(state, new BigInt((int64_t)0)); + BigInt* r2 = quotient->addition(state, new BigInt((int64_t)1)); + return applyUnsignedRoundingMode(state, quotient, r1, r2, unsignedRoundingMode)->multiply(state, new BigInt(increment)); +} + +static int64_t temporalFloor(double num) { return (num < 0 ? -1 : 1) * std::ceil(std::abs(num)); } -int64_t TemporalObject::modulo(int64_t num1, int64_t num2) +static int64_t temporalModulo(int64_t num1, int64_t num2) { - return num1 -= TemporalObject::floor(num1 / (double)num2); + return num1 -= temporalFloor(num1 / (double)num2); } Value TemporalPlainTimeObject::createTemporalTime(ExecutionState& state, int hour, int minute, int second, int millisecond, int microsecond, int nanosecond, Optional newTarget) { TemporalTime time(hour, minute, second, millisecond, microsecond, nanosecond); - TemporalCalendarObject* calendar = new TemporalCalendarObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalCalendarPrototype(), state.context()->staticStrings().lazyISO8601().string()); + TemporalCalendarObject* calendar = new TemporalCalendarObject(state, state.context()->globalObject()->temporalCalendarPrototype(), state.context()->staticStrings().lazyISO8601().string()); - return new TemporalPlainTimeObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalPlainTimePrototype(), time, calendar); + return new TemporalPlainTimeObject(state, state.context()->globalObject()->temporalPlainTimePrototype(), time, calendar); } Value TemporalPlainTimeObject::createFromPlainDateTimeObject(ExecutionState& state, TemporalPlainDateTimeObject* plainDateTime) @@ -903,17 +942,17 @@ std::map TemporalPlainTimeObject::balanceTim { std::map result; - result[TemporalObject::MICROSECOND_UNIT] = microsecond + TemporalObject::floor(nanosecond / 1000.0); + result[TemporalObject::MICROSECOND_UNIT] = microsecond + temporalFloor(nanosecond / 1000.0); result[TemporalObject::NANOSECOND_UNIT] = nanosecond < 0 ? 1000 + nanosecond % 1000 : nanosecond % 1000; - result[TemporalObject::MILLISECOND_UNIT] = millisecond + TemporalObject::floor(result[TemporalObject::MICROSECOND_UNIT] / 1000); - result[TemporalObject::MICROSECOND_UNIT] = TemporalObject::modulo(result[TemporalObject::MICROSECOND_UNIT], 1000); - result[TemporalObject::SECOND_UNIT] = second + TemporalObject::floor(result[TemporalObject::MILLISECOND_UNIT] / 1000); + result[TemporalObject::MILLISECOND_UNIT] = millisecond + temporalFloor(result[TemporalObject::MICROSECOND_UNIT] / 1000); + result[TemporalObject::MICROSECOND_UNIT] = temporalModulo(result[TemporalObject::MICROSECOND_UNIT], 1000); + result[TemporalObject::SECOND_UNIT] = second + temporalFloor(result[TemporalObject::MILLISECOND_UNIT] / 1000); result[TemporalObject::MILLISECOND_UNIT] %= 1000; - result[TemporalObject::MINUTE_UNIT] = minute + TemporalObject::floor(result[TemporalObject::SECOND_UNIT] / 60); + result[TemporalObject::MINUTE_UNIT] = minute + temporalFloor(result[TemporalObject::SECOND_UNIT] / 60); result[TemporalObject::SECOND_UNIT] %= 60; - result[TemporalObject::HOUR_UNIT] = hour + TemporalObject::floor(result[TemporalObject::MINUTE_UNIT] / 60); + result[TemporalObject::HOUR_UNIT] = hour + temporalFloor(result[TemporalObject::MINUTE_UNIT] / 60); result[TemporalObject::MINUTE_UNIT] %= 60; - result[TemporalObject::DAY_UNIT] = TemporalObject::floor(result[TemporalObject::HOUR_UNIT] / 24); + result[TemporalObject::DAY_UNIT] = temporalFloor(result[TemporalObject::HOUR_UNIT] / 24); result[TemporalObject::HOUR_UNIT] %= 24; return result; @@ -958,8 +997,8 @@ Value TemporalPlainTimeObject::toTemporalTime(ExecutionState& state, const Value return TemporalPlainTimeObject::createTemporalTime(state, result[TemporalObject::HOUR_UNIT], result[TemporalObject::MINUTE_UNIT], result[TemporalObject::SECOND_UNIT], result[TemporalObject::MILLISECOND_UNIT], result[TemporalObject::MICROSECOND_UNIT], result[TemporalObject::NANOSECOND_UNIT], nullptr); } - Temporal::toTemporalOverflow(state, options); - auto tmp = TemporalObject::parseTemporalDateTimeString(state, item.asString()->toNonGCUTF8StringData()); + TemporalObject::toTemporalOverflow(state, options); + auto tmp = parseTemporalDateTimeString(state, item.asString()->toNonGCUTF8StringData()); ASSERT(TemporalPlainTimeObject::isValidTime(state, tmp.hour, tmp.minute, tmp.second, tmp.millisecond, tmp.microsecond, tmp.nanosecond)); if (tmp.calendar->length() != 0 && !tmp.calendar->equals("iso8601")) { @@ -981,16 +1020,16 @@ std::map TemporalPlainTimeObject::toTemporal Value(state.context()->staticStrings().lazyMinute().string()), Value(state.context()->staticStrings().lazyNanosecond().string()), Value(state.context()->staticStrings().lazySecond().string()) }; - Value partial = TemporalCalendarObject::prepareTemporalFields(state, temporalTimeLike, values, {}); + Value partial = prepareTemporalFields(state, temporalTimeLike, values, {}); for (auto i : temporalTimeLikeProp) { - ObjectHasPropertyResult objectHasPropertyResult = partial.asObject()->hasProperty(state, ObjectPropertyName(state, TemporalObject::dateTimeUnitString(state, i))); + ObjectHasPropertyResult objectHasPropertyResult = partial.asObject()->hasProperty(state, ObjectPropertyName(state, dateTimeUnitString(state, i))); if (!objectHasPropertyResult.hasProperty()) { ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, "any is false"); } - Value value = objectHasPropertyResult.value(state, ObjectPropertyName(state, TemporalObject::dateTimeUnitString(state, i)), partial); + Value value = objectHasPropertyResult.value(state, ObjectPropertyName(state, dateTimeUnitString(state, i)), partial); if (!value.isInt32() || (value.isDouble() && !std::isfinite(value.asDouble()))) { ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, "any is false"); @@ -1045,7 +1084,7 @@ std::map TemporalPlainTimeObject::toPartia bool any = false; for (auto i : temporalTimeLikeProp) { - Value value = temporalTimeLike.asObject()->get(state, ObjectPropertyName(state, TemporalObject::dateTimeUnitString(state, i))).value(state, temporalTimeLike); + Value value = temporalTimeLike.asObject()->get(state, ObjectPropertyName(state, dateTimeUnitString(state, i))).value(state, temporalTimeLike); if (!value.isUndefined()) { any = true; @@ -1114,7 +1153,7 @@ TemporalCalendarObject* TemporalCalendarObject::createTemporalCalendar(Execution { ASSERT(TemporalCalendarObject::isBuiltinCalendar(id)); - return new TemporalCalendarObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalCalendarPrototype(), id); + return new TemporalCalendarObject(state, state.context()->globalObject()->temporalCalendarPrototype(), id); } Value TemporalCalendarObject::getBuiltinCalendar(ExecutionState& state, String* id) @@ -1178,7 +1217,7 @@ Value TemporalCalendarObject::parseTemporalCalendarString(ExecutionState& state, if (isoString.asString()->equals(String::emptyString)) { return Value(state.context()->staticStrings().lazyISO8601().string()); } - TemporalObject::DateTime time = TemporalObject::parseValidIso8601String(state, isoString.asString()->toNonGCUTF8StringData()); + TemporalObject::DateTime time = parseValidIso8601String(state, isoString.asString()->toNonGCUTF8StringData()); return time.calendar->length() == 0 ? Value(state.context()->staticStrings().lazyISO8601().string()) : Value(time.calendar); } @@ -1452,10 +1491,10 @@ std::map TemporalCalendarObject::ISODateFrom { ASSERT(fields.isObject()); - auto overflow = Temporal::toTemporalOverflow(state, options); + auto overflow = TemporalObject::toTemporalOverflow(state, options); ValueVector fieldNames = { Value(state.context()->staticStrings().lazyDay().string()), Value(state.context()->staticStrings().lazyMonth().string()), Value(state.context()->staticStrings().lazyMonthCode().string()), Value(state.context()->staticStrings().lazyYear().string()) }; ValueVector requiredFields = { Value(state.context()->staticStrings().lazyDay().string()), Value(state.context()->staticStrings().lazyYear().string()) }; - fields = Temporal::prepareTemporalFields(state, fields, fieldNames, requiredFields); + fields = prepareTemporalFields(state, fields, fieldNames, requiredFields); auto year = fields.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().lazyYear().string())).value(state, fields); ASSERT(year.isNumber()); int month = TemporalCalendarObject::resolveISOMonth(state, fields); @@ -1591,7 +1630,7 @@ Value TemporalPlainDateObject::createTemporalDate(ExecutionState& state, const i } TemporalDate date(isoYear, isoMonth, isoDay); - return new TemporalPlainDateObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalPlainDatePrototype(), date, calendar.asObject()->asTemporalCalendarObject()); + return new TemporalPlainDateObject(state, state.context()->globalObject()->temporalPlainDatePrototype(), date, calendar.asObject()->asTemporalCalendarObject()); } Value TemporalPlainDateObject::createFromPlainDateTimeObject(ExecutionState& state, TemporalPlainDateTimeObject* plainDateTime) @@ -1608,7 +1647,7 @@ Value TemporalPlainDateObject::toTemporalDate(ExecutionState& state, const Value ASSERT(options->isObject()); if (item.isObject()) { - Temporal* tItem = item.asObject()->asTemporalObject(); + TemporalObject* tItem = item.asObject()->asTemporalObject(); if (tItem->isTemporalPlainDateObject()) { return item; @@ -1632,12 +1671,12 @@ Value TemporalPlainDateObject::toTemporalDate(ExecutionState& state, const Value Value(state.context()->staticStrings().lazyYear().string()) }; ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, calendar, ValueVector()); - Value fields = Temporal::prepareTemporalFields(state, item, fieldNames, ValueVector()); + Value fields = prepareTemporalFields(state, item, fieldNames, ValueVector()); return TemporalCalendarObject::dateFromFields(state, calendar, fields, options.value()); } - Temporal::toTemporalOverflow(state, options.value()); - auto result = TemporalObject::parseTemporalDateString(state, item.toString(state)->toNonGCUTF8StringData()); + TemporalObject::toTemporalOverflow(state, options.value()); + auto result = parseTemporalDateString(state, item.toString(state)->toNonGCUTF8StringData()); ASSERT(TemporalPlainDateObject::isValidISODate(state, result.year, result.month, result.day)); return TemporalPlainDateObject::createTemporalDate(state, result.year, result.month, result.day, @@ -1773,7 +1812,7 @@ Value TemporalPlainDateTimeObject::createTemporalDateTime(ExecutionState& state, TemporalDate date(isoYear, isoMonth, isoDay); TemporalTime time(hour, minute, second, millisecond, microsecond, nanosecond); - return new TemporalPlainDateTimeObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalPlainDateTimePrototype(), date, time, calendar.asObject()->asTemporalCalendarObject()); + return new TemporalPlainDateTimeObject(state, state.context()->globalObject()->temporalPlainDateTimePrototype(), date, time, calendar.asObject()->asTemporalCalendarObject()); } Value TemporalPlainDateTimeObject::createFromPlainDateObject(ExecutionState& state, TemporalPlainDateObject* plainDate) @@ -1785,7 +1824,7 @@ Value TemporalPlainDateTimeObject::createFromPlainDateObject(ExecutionState& sta std::map TemporalPlainDateTimeObject::interpretTemporalDateTimeFields(ExecutionState& state, const Value& calendar, const Value& fields, const Value& options) { auto timeResult = TemporalPlainTimeObject::toTemporalTimeRecord(state, fields); - auto overFlow = Temporal::toTemporalOverflow(state, options); + auto overFlow = TemporalObject::toTemporalOverflow(state, options); auto temporalDate = TemporalCalendarObject::dateFromFields(state, calendar, fields, options).asObject()->asTemporalPlainDateObject(); timeResult = TemporalPlainTimeObject::regulateTime(state, timeResult[TemporalObject::HOUR_UNIT], timeResult[TemporalObject::MINUTE_UNIT], timeResult[TemporalObject::SECOND_UNIT], timeResult[TemporalObject::MILLISECOND_UNIT], timeResult[TemporalObject::MICROSECOND_UNIT], timeResult[TemporalObject::NANOSECOND_UNIT], overFlow); timeResult[TemporalObject::YEAR_UNIT] = temporalDate->year(); @@ -1823,12 +1862,12 @@ Value TemporalPlainDateTimeObject::toTemporalDateTime(ExecutionState& state, con Value(state.context()->staticStrings().lazySecond().string()), Value(state.context()->staticStrings().lazyYear().string()) }; ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, calendar, values); - Value fields = Temporal::prepareTemporalFields(state, item, fieldNames, ValueVector()); + Value fields = prepareTemporalFields(state, item, fieldNames, ValueVector()); result = TemporalPlainDateTimeObject::interpretTemporalDateTimeFields(state, calendar, fields, options); return TemporalPlainDateTimeObject::createTemporalDateTime(state, result[TemporalObject::YEAR_UNIT], result[TemporalObject::MONTH_UNIT], result[TemporalObject::DAY_UNIT], result[TemporalObject::HOUR_UNIT], result[TemporalObject::MINUTE_UNIT], result[TemporalObject::SECOND_UNIT], result[TemporalObject::MILLISECOND_UNIT], result[TemporalObject::MICROSECOND_UNIT], result[TemporalObject::NANOSECOND_UNIT], calendar, new Object(state)); } - Temporal::toTemporalOverflow(state, options); - auto tmp = TemporalObject::parseTemporalDateTimeString(state, item.toString(state)->toNonGCUTF8StringData()); + TemporalObject::toTemporalOverflow(state, options); + auto tmp = parseTemporalDateTimeString(state, item.toString(state)->toNonGCUTF8StringData()); ASSERT(TemporalPlainDateObject::isValidISODate(state, tmp.year, tmp.month, tmp.day)); ASSERT(TemporalPlainTimeObject::isValidTime(state, tmp.hour, tmp.minute, tmp.second, tmp.millisecond, tmp.microsecond, tmp.nanosecond)); @@ -1852,7 +1891,7 @@ Value TemporalPlainDateTimeObject::addDurationToOrSubtractDurationFromPlainDateT auto durationObject = TemporalDurationObject::toTemporalDuration(state, temporalDurationLike).asObject()->asTemporalDurationObject(); std::map time = { { TemporalObject::YEAR_UNIT, temporalDateTime->getYear() }, { TemporalObject::MONTH_UNIT, temporalDateTime->getMonth() }, { TemporalObject::DAY_UNIT, temporalDateTime->getDay() }, { TemporalObject::HOUR_UNIT, temporalDateTime->getHour() }, { TemporalObject::MINUTE_UNIT, temporalDateTime->getMinute() }, { TemporalObject::SECOND_UNIT, temporalDateTime->getSecond() }, { TemporalObject::MILLISECOND_UNIT, temporalDateTime->getMillisecond() }, { TemporalObject::MICROSECOND_UNIT, temporalDateTime->getMicrosecond() }, { TemporalObject::NANOSECOND_UNIT, temporalDateTime->getNanosecond() } }; std::map duration = { { TemporalObject::YEAR_UNIT, operation * durationObject->getYear() }, { TemporalObject::MONTH_UNIT, operation * durationObject->getMonth() }, { TemporalObject::WEEK_UNIT, operation * durationObject->getWeek() }, { TemporalObject::DAY_UNIT, operation * durationObject->getDay() }, { TemporalObject::HOUR_UNIT, operation * durationObject->getHour() }, { TemporalObject::MINUTE_UNIT, operation * durationObject->getMinute() }, { TemporalObject::SECOND_UNIT, operation * durationObject->getMinute() }, { TemporalObject::MILLISECOND_UNIT, operation * durationObject->getMillisecond() }, { TemporalObject::MICROSECOND_UNIT, operation * durationObject->getMicrosecond() }, { TemporalObject::NANOSECOND_UNIT, operation * durationObject->getNanosecond() } }; - auto result = TemporalPlainDateTimeObject::addDateTime(state, time, temporalDateTime->getCalendar(), duration, Temporal::getOptionsObject(state, options).asObject()); + auto result = TemporalPlainDateTimeObject::addDateTime(state, time, temporalDateTime->getCalendar(), duration, TemporalObject::getOptionsObject(state, options).asObject()); if (!TemporalPlainDateObject::isValidISODate(state, result[TemporalObject::YEAR_UNIT], result[TemporalObject::MONTH_UNIT], result[TemporalObject::DAY_UNIT]) || !TemporalPlainTimeObject::isValidTime(state, result[TemporalObject::HOUR_UNIT], result[TemporalObject::MINUTE_UNIT], result[TemporalObject::SECOND_UNIT], result[TemporalObject::MILLISECOND_UNIT], result[TemporalObject::MICROSECOND_UNIT], result[TemporalObject::NANOSECOND_UNIT])) { ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, "Invalid date or time"); @@ -1884,7 +1923,7 @@ std::map TemporalPlainDateTimeObject::differ TemporalPlainDateObject* date1 = TemporalPlainDateObject::createTemporalDate(state, adjustedDate[TemporalObject::YEAR_UNIT], adjustedDate[TemporalObject::MONTH_UNIT], adjustedDate[TemporalObject::DAY_UNIT], calendar).asObject()->asTemporalPlainDateObject(); TemporalPlainDateObject* date2 = TemporalPlainDateObject::createTemporalDate(state, second[TemporalObject::YEAR_UNIT], second[TemporalObject::MONTH_UNIT], second[TemporalObject::DAY_UNIT], calendar).asObject()->asTemporalPlainDateObject(); TemporalObject::DateTimeUnits dateLargestUnit = TemporalObject::DAY_UNIT > largestUnit ? TemporalObject::DAY_UNIT : largestUnit; - Object* untilOptions = TemporalObject::mergeLargestUnitOption(state, options, largestUnit); + Object* untilOptions = mergeLargestUnitOption(state, options, largestUnit); TemporalDurationObject* dateDifference = TemporalCalendarObject::calendarDateUntil(state, calendar, date1, date2, untilOptions).asObject()->asTemporalDurationObject(); std::map balanceResult = TemporalDurationObject::balanceDuration(state, { { TemporalObject::DAY_UNIT, dateDifference->getDay() }, { TemporalObject::HOUR_UNIT, timeDifference[TemporalObject::HOUR_UNIT] }, { TemporalObject::MINUTE_UNIT, timeDifference[TemporalObject::MINUTE_UNIT] }, { TemporalObject::SECOND_UNIT, timeDifference[TemporalObject::SECOND_UNIT] }, { TemporalObject::MILLISECOND_UNIT, timeDifference[TemporalObject::MILLISECOND_UNIT] }, { TemporalObject::MICROSECOND_UNIT, timeDifference[TemporalObject::MICROSECOND_UNIT] }, { TemporalObject::NANOSECOND_UNIT, timeDifference[TemporalObject::NANOSECOND_UNIT] } }, largestUnit); @@ -1908,7 +1947,7 @@ Value TemporalZonedDateTimeObject::createTemporalZonedDateTime(ExecutionState& s { ASSERT(TemporalInstantObject::isValidEpochNanoseconds(&epochNanoseconds)); - return new TemporalZonedDateTimeObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalZonedDateTimePrototype(), &epochNanoseconds, timeZone, const_cast(calendar)); + return new TemporalZonedDateTimeObject(state, state.context()->globalObject()->temporalZonedDateTimePrototype(), &epochNanoseconds, timeZone, const_cast(calendar)); } Value TemporalZonedDateTimeObject::toTemporalZonedDateTime(ExecutionState& state, const Value& item, const Value& options) @@ -1941,7 +1980,7 @@ Value TemporalZonedDateTimeObject::toTemporalZonedDateTime(ExecutionState& state auto fieldNames = TemporalCalendarObject::calendarFields(state, calendar, values); fieldNames.push_back(Value(state.context()->staticStrings().lazyTimeZone().string())); fieldNames.push_back(Value(state.context()->staticStrings().lazyOffset().string())); - auto fields = Temporal::prepareTemporalFields(state, item, fieldNames, { Value(state.context()->staticStrings().lazyTimeZone().string()) }); + auto fields = prepareTemporalFields(state, item, fieldNames, { Value(state.context()->staticStrings().lazyTimeZone().string()) }); timeZone = TemporalTimeZoneObject::toTemporalTimeZone(state, fields.asObject()->get(state, ObjectPropertyName(state.context()->staticStrings().lazyTimeZone())).value(state, fields)).asObject()->asTemporalTimeZoneObject(); auto offsetStringValue = fields.asObject()->get(state, ObjectPropertyName(state.context()->staticStrings().lazyOffset())).value(state, fields); @@ -1953,8 +1992,8 @@ Value TemporalZonedDateTimeObject::toTemporalZonedDateTime(ExecutionState& state result = TemporalPlainDateTimeObject::interpretTemporalDateTimeFields(state, calendar, fields, options); } else { - Temporal::toTemporalOverflow(state, options); - auto parseResult = TemporalObject::parseTemporalZonedDateTimeString(state, item.asString()->toNonGCUTF8StringData()); + TemporalObject::toTemporalOverflow(state, options); + auto parseResult = parseTemporalZonedDateTimeString(state, item.asString()->toNonGCUTF8StringData()); ASSERT(parseResult.tz->name->length() != 0); unsigned int index = 0; std::string timeZoneName = parseResult.tz->name->toNonGCUTF8StringData(); @@ -1986,8 +2025,8 @@ Value TemporalZonedDateTimeObject::toTemporalZonedDateTime(ExecutionState& state offsetNanoseconds = TemporalInstantObject::offsetStringToNanoseconds(state, offsetString); } - auto disambiguation = Temporal::toTemporalDisambiguation(state, options); - auto offsetOption = Temporal::toTemporalOffset(state, options, state.context()->staticStrings().reject.string()); + auto disambiguation = TemporalObject::toTemporalDisambiguation(state, options); + auto offsetOption = TemporalObject::toTemporalOffset(state, options, state.context()->staticStrings().reject.string()); auto epochNanoseconds = TemporalZonedDateTimeObject::interpretISODateTimeOffset(state, result, offsetBehaviour, offsetNanoseconds, timeZone, disambiguation, offsetOption, matchBehaviour).toBigInt(state); return TemporalZonedDateTimeObject::createTemporalZonedDateTime(state, *epochNanoseconds, timeZone, calendar); } @@ -2169,7 +2208,7 @@ Value TemporalInstantObject::createTemporalInstant(ExecutionState& state, const ASSERT(epochNanoseconds.isBigInt()); ASSERT(TemporalInstantObject::isValidEpochNanoseconds(epochNanoseconds)); - auto* object = new TemporalInstantObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalInstantPrototype()); + auto* object = new TemporalInstantObject(state, state.context()->globalObject()->temporalInstantPrototype()); object->setNanoseconds(epochNanoseconds.asBigInt()); return object; @@ -2213,7 +2252,7 @@ Value TemporalInstantObject::toTemporalInstant(ExecutionState& state, const Valu Value TemporalInstantObject::parseTemporalInstant(ExecutionState& state, const std::string& isoString) { - auto result = TemporalObject::parseTemporalInstantString(state, isoString); + auto result = parseTemporalInstantString(state, isoString); int64_t offsetNanoseconds = offsetStringToNanoseconds(state, result.tz->offsetString); time64_t utc = TemporalPlainDateTimeObject::getEpochFromISOParts(state, result.year, result.month, result.day, result.hour, result.minute, result.second, result.millisecond, result.microsecond, result.nanosecond); auto utcWithOffset = new BigInt(utc - offsetNanoseconds); @@ -2306,7 +2345,7 @@ BigInt* TemporalInstantObject::roundTemporalInstant(ExecutionState& state, BigIn break; } - return TemporalObject::roundNumberToIncrementAsIfPositive(state, ns, incrementNs, roundingMode); + return roundNumberToIncrementAsIfPositive(state, ns, incrementNs, roundingMode); } Value TemporalInstantObject::addDurationToOrSubtractDurationFromInstant(ExecutionState& state, TemporalPlainTimeObject::Operation operation, TemporalInstantObject* instant, const Value& other, const Value& options) @@ -2409,10 +2448,10 @@ Value TemporalTimeZoneObject::createTemporalTimeZone(ExecutionState& state, cons Object* proto; if (newTarget.hasValue()) { proto = Object::getPrototypeFromConstructor(state, newTarget.value(), [](ExecutionState& state, Context* constructorRealm) -> Object* { - return state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalTimeZonePrototype(); + return state.context()->globalObject()->temporalTimeZonePrototype(); }); } else { - proto = state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalTimeZonePrototype(); + proto = state.context()->globalObject()->temporalTimeZonePrototype(); } if (TemporalTimeZoneObject::isValidTimeZoneName(identifier)) { @@ -2505,7 +2544,7 @@ Value TemporalTimeZoneObject::toTemporalTimeZone(ExecutionState& state, const Va ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, "string expected"); } - TemporalObject::TimeZone parseResult = TemporalObject::parseTemporalTimeZoneString(state, timeZoneLike.isUndefined() ? temporalTimeZoneLike.asString()->toNonGCUTF8StringData() : timeZoneLike.asString()->toNonGCUTF8StringData()); + TemporalObject::TimeZone parseResult = parseTemporalTimeZoneString(state, timeZoneLike.isUndefined() ? temporalTimeZoneLike.asString()->toNonGCUTF8StringData() : timeZoneLike.asString()->toNonGCUTF8StringData()); if (parseResult.name->length() != 0) { unsigned int index = 0; @@ -2778,10 +2817,10 @@ Value TemporalPlainYearMonthObject::createTemporalYearMonth(ExecutionState& stat } if (!newTarget.hasValue()) { - newTarget = state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalPlainYearMonthPrototype(); + newTarget = state.context()->globalObject()->temporalPlainYearMonthPrototype(); } - return new TemporalPlainYearMonthObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalPlainYearMonthPrototype(), isoYear, isoMonth, calendar.asObject()->asTemporalCalendarObject(), referenceISODay); + return new TemporalPlainYearMonthObject(state, state.context()->globalObject()->temporalPlainYearMonthPrototype(), isoYear, isoMonth, calendar.asObject()->asTemporalCalendarObject(), referenceISODay); } bool TemporalPlainYearMonthObject::isoYearMonthWithinLimits(int isoYear, int isoMonth) @@ -2801,12 +2840,12 @@ Value TemporalPlainYearMonthObject::toTemporalYearMonth(ExecutionState& state, c StaticStrings& strings = state.context()->staticStrings(); auto calendar = TemporalCalendarObject::getTemporalCalendarWithISODefault(state, item); auto fieldNames = TemporalCalendarObject::calendarFields(state, calendar, { strings.lazyMonth().string(), strings.lazyMonthCode().string(), strings.lazyYear().string() }); - auto fields = Temporal::prepareTemporalFields(state, item, fieldNames, {}); + auto fields = prepareTemporalFields(state, item, fieldNames, {}); return TemporalCalendarObject::calendarYearMonthFromFields(state, calendar, fields, options); } - Temporal::toTemporalOverflow(state, options); - auto result = TemporalObject::parseTemporalYearMonthString(state, item.asString()->toNonGCUTF8StringData()); + TemporalObject::toTemporalOverflow(state, options); + auto result = parseTemporalYearMonthString(state, item.asString()->toNonGCUTF8StringData()); auto calendar = TemporalCalendarObject::toTemporalCalendarWithISODefault(state, Value(result.calendar)); auto retVal = TemporalPlainYearMonthObject::createTemporalYearMonth(state, result.year, result.month, calendar, result.day); @@ -2823,9 +2862,9 @@ Value TemporalPlainYearMonthObject::addDurationToOrSubtractDurationFromPlainYear std::map tmp = { { TemporalObject::DAY_UNIT, duration->getDay() }, { TemporalObject::HOUR_UNIT, duration->getHour() }, { TemporalObject::MINUTE_UNIT, duration->getMinute() }, { TemporalObject::SECOND_UNIT, duration->getSecond() }, { TemporalObject::MILLISECOND_UNIT, duration->getMillisecond() }, { TemporalObject::MICROSECOND_UNIT, duration->getMicrosecond() }, { TemporalObject::NANOSECOND_UNIT, duration->getNanosecond() } }; std::map balanceResult = TemporalDurationObject::balanceDuration(state, tmp, TemporalObject::DAY_UNIT); - Value optionsObject = Temporal::getOptionsObject(state, options); + Value optionsObject = TemporalObject::getOptionsObject(state, options); ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, yearMonth->getCalendar(), { Value(state.context()->staticStrings().lazyMonthCode().string()), Value(state.context()->staticStrings().lazyYear().string()) }); - Value fields = Temporal::prepareTemporalFields(state, yearMonth, fieldNames, {}); + Value fields = prepareTemporalFields(state, yearMonth, fieldNames, {}); int durationArray[] = { duration->getYear(), duration->getMonth(), duration->getWeek(), balanceResult[TemporalObject::DAY_UNIT], 0, 0, 0, 0, 0, 0 }; int sign = TemporalDurationObject::durationSign(durationArray); int day = 1; @@ -2850,7 +2889,7 @@ Value TemporalPlainYearMonthObject::addDurationToOrSubtractDurationFromPlainYear } Value addedDate = TemporalCalendarObject::calendarDateAdd(state, yearMonth->getCalendar(), date, durationToAdd, options); - Value addedDateFields = Temporal::prepareTemporalFields(state, addedDate, fieldNames, {}); + Value addedDateFields = prepareTemporalFields(state, addedDate, fieldNames, {}); return TemporalCalendarObject::calendarYearMonthFromFields(state, yearMonth->getCalendar(), addedDateFields, optionsCopy); } @@ -2896,7 +2935,7 @@ Value TemporalDurationObject::createTemporalDuration(ExecutionState& state, int ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, "Invalid time"); } - return new TemporalDurationObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalDurationPrototype(), years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds); + return new TemporalDurationObject(state, state.context()->globalObject()->temporalDurationPrototype(), years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds); } Value TemporalDurationObject::toTemporalDuration(ExecutionState& state, const Value& item) @@ -2913,7 +2952,7 @@ Value TemporalDurationObject::toTemporalDuration(ExecutionState& state, const Va std::map TemporalDurationObject::toTemporalDurationRecord(ExecutionState& state, const Value& temporalDurationLike) { if (!temporalDurationLike.isObject()) { - return TemporalObject::parseTemporalDurationString(state, temporalDurationLike.asString()->toNonGCUTF8StringData()); + return parseTemporalDurationString(state, temporalDurationLike.asString()->toNonGCUTF8StringData()); } else if (temporalDurationLike.asObject()->isTemporalDurationObject()) { auto duration = temporalDurationLike.asObject()->asTemporalDurationObject(); return TemporalDurationObject::createDurationRecord(state, duration->getYear(), duration->getMonth(), duration->getWeek(), duration->getDay(), duration->getHour(), duration->getMinute(), duration->getSecond(), duration->getMillisecond(), duration->getMicrosecond(), duration->getNanosecond()); @@ -2950,7 +2989,7 @@ std::map TemporalDurationObject::toTempora bool any = false; for (auto i : temporalTimeLikeProp) { - Value value = temporalDurationLike.asObject()->get(state, ObjectPropertyName(state, TemporalObject::dateTimeUnitString(state, i))).value(state, temporalDurationLike); + Value value = temporalDurationLike.asObject()->get(state, ObjectPropertyName(state, dateTimeUnitString(state, i))).value(state, temporalDurationLike); if (!value.isUndefined()) { any = true; @@ -2984,7 +3023,7 @@ Value TemporalDurationObject::createNegatedTemporalDuration(ExecutionState& stat Value TemporalDurationObject::addDurationToOrSubtractDurationFromDuration(ExecutionState& state, TemporalPlainTimeObject::Operation operation, TemporalDurationObject* duration, const Value& other, const Value& options) { auto otherDurationObject = TemporalDurationObject::toTemporalDurationRecord(state, other); - auto relativeTo = TemporalObject::toRelativeTemporalObject(state, Temporal::getOptionsObject(state, options).asObject()); + auto relativeTo = toRelativeTemporalObject(state, TemporalObject::getOptionsObject(state, options).asObject()); TemporalDurationObject* otherObject = other.asObject()->asTemporalDurationObject(); std::map durationMap1 = { { TemporalObject::YEAR_UNIT, duration->getYear() }, { TemporalObject::MONTH_UNIT, duration->getMonth() }, { TemporalObject::WEEK_UNIT, duration->getWeek() }, { TemporalObject::DAY_UNIT, duration->getDay() }, { TemporalObject::HOUR_UNIT, duration->getHour() }, { TemporalObject::MINUTE_UNIT, duration->getMinute() }, { TemporalObject::SECOND_UNIT, duration->getSecond() }, { TemporalObject::MILLISECOND_UNIT, duration->getMillisecond() }, { TemporalObject::MICROSECOND_UNIT, duration->getMicrosecond() }, { TemporalObject::NANOSECOND_UNIT, duration->getNanosecond() } }; std::map durationMap2 = { { TemporalObject::YEAR_UNIT, operation * otherObject->getYear() }, { TemporalObject::MONTH_UNIT, operation * otherObject->getMonth() }, { TemporalObject::WEEK_UNIT, operation * otherObject->getWeek() }, { TemporalObject::DAY_UNIT, operation * otherObject->getDay() }, { TemporalObject::HOUR_UNIT, operation * otherObject->getHour() }, { TemporalObject::MINUTE_UNIT, operation * otherObject->getMinute() }, { TemporalObject::SECOND_UNIT, operation * otherObject->getSecond() }, { TemporalObject::MILLISECOND_UNIT, operation * otherObject->getMillisecond() }, { TemporalObject::MICROSECOND_UNIT, operation * otherObject->getMicrosecond() }, { TemporalObject::NANOSECOND_UNIT, operation * otherObject->getNanosecond() } }; @@ -3028,7 +3067,7 @@ std::map TemporalDurationObject::addDuration Value end = TemporalCalendarObject::calendarDateAdd(state, calendar, intermediate, dateDuration2, Value(), dateAdd); auto dateLargestUnit = TemporalObject::DAY_UNIT > largestUnit ? TemporalObject::DAY_UNIT : largestUnit; auto differenceOptions = new Object(state, Object::PrototypeIsNull); - differenceOptions->defineOwnProperty(state, ObjectPropertyName(state.context()->staticStrings().lazyLargestUnit()), ObjectPropertyDescriptor(TemporalObject::dateTimeUnitString(state, dateLargestUnit), ObjectPropertyDescriptor::AllPresent)); + differenceOptions->defineOwnProperty(state, ObjectPropertyName(state.context()->staticStrings().lazyLargestUnit()), ObjectPropertyDescriptor(dateTimeUnitString(state, dateLargestUnit), ObjectPropertyDescriptor::AllPresent)); auto dateDifference = TemporalCalendarObject::calendarDateUntil(state, calendar, relativeTo, end, differenceOptions).asObject()->asTemporalDurationObject(); duration[TemporalObject::DAY_UNIT] = dateDifference->getDay(); auto result = TemporalDurationObject::balanceDuration(state, duration, largestUnit); @@ -3199,7 +3238,7 @@ Value TemporalPlainMonthDayObject::createTemporalMonthDay(ExecutionState& state, ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, "Invalid date"); } - return new TemporalPlainMonthDayObject(state, state.context()->globalObject()->temporal()->asTemporalObject()->getTemporalPlainMonthDayPrototype(), isoMonth, isoDay, calendar, referenceISOYear); + return new TemporalPlainMonthDayObject(state, state.context()->globalObject()->temporalPlainMonthDayPrototype(), isoMonth, isoDay, calendar, referenceISOYear); } Value TemporalPlainMonthDayObject::toTemporalMonthDay(ExecutionState& state, const Value& item, const Value& options) @@ -3210,8 +3249,8 @@ Value TemporalPlainMonthDayObject::toTemporalMonthDay(ExecutionState& state, con int referenceISOYear = 1972; if (!item.isObject()) { - Temporal::toTemporalOverflow(state, options); - auto result = TemporalObject::parseTemporalMonthDayString(state, item.asString()->toNonGCUTF8StringData()); + TemporalObject::toTemporalOverflow(state, options); + auto result = parseTemporalMonthDayString(state, item.asString()->toNonGCUTF8StringData()); auto calendar = TemporalCalendarObject::toTemporalCalendarWithISODefault(state, Value(result.calendar)); if (result.year == 0) { @@ -3238,7 +3277,7 @@ Value TemporalPlainMonthDayObject::toTemporalMonthDay(ExecutionState& state, con } ValueVector fieldNames = TemporalCalendarObject::calendarFields(state, calendar, { strings.lazyDay().string(), strings.lazyMonth().string(), strings.lazyMonthCode().string(), strings.lazyYear().string() }); - Value fields = Temporal::prepareTemporalFields(state, item, fieldNames, {}); + Value fields = prepareTemporalFields(state, item, fieldNames, {}); Value month = fields.asObject()->get(state, strings.lazyMonth()).value(state, fields); Value monthCode = fields.asObject()->get(state, strings.lazyMonthCode()).value(state, fields); Value year = fields.asObject()->get(state, strings.lazyYear()).value(state, fields); diff --git a/src/runtime/TemporalObject.h b/src/runtime/TemporalObject.h index d8e316fbf..a3bea1a0d 100644 --- a/src/runtime/TemporalObject.h +++ b/src/runtime/TemporalObject.h @@ -22,10 +22,11 @@ #define __EscargotTemporalObject__ #include "Escargot.h" +#include "Context.h" #include "runtime/Object.h" #include "runtime/GlobalObject.h" -#include "runtime/Temporal.h" #include "runtime/DateObject.h" +#include "intl/Intl.h" namespace Escargot { @@ -103,7 +104,7 @@ enum UnsignedRoundingMode { static UnsignedRoundingMode positiveUnsignedRoundingMode[] = { INF, ZERO, INF, ZERO, HALF_INF, HALF_ZERO, HALF_INF, HALF_ZERO }; static UnsignedRoundingMode negativeUnsignedRoundingMode[] = { ZERO, INF, INF, ZERO, HALF_ZERO, HALF_INF, HALF_INF, HALF_ZERO }; -class TemporalObject : public Temporal { +class TemporalObject : public DerivedObject { public: class TimeZone : public gc { public: @@ -146,50 +147,88 @@ class TemporalObject : public Temporal { explicit TemporalObject(ExecutionState& state); explicit TemporalObject(ExecutionState& state, Object* proto); - virtual bool hasCalendar() const + + virtual bool isTemporalObject() const override { - return false; + return true; } - bool isTemporalObject() const + + virtual bool hasCalendar() const { - return true; + return false; } + virtual TemporalCalendarObject* getCalendar() const { return nullptr; } + static Value toISODateTime(ExecutionState& state, DateObject& d); static Value toISODate(ExecutionState& state, DateObject& d); static Value toISOTime(ExecutionState& state, DateObject& d); - static String* dateTimeUnitString(ExecutionState& state, DateTimeUnits unit); - - static TemporalObject::DateTime parseValidIso8601String(ExecutionState& state, std::string isoString, bool parseTimeZone); - static TemporalObject::DateTime parseTemporalInstantString(ExecutionState& state, const std::string& isoString); - static TemporalObject::DateTime parseTemporalZonedDateTimeString(ExecutionState& state, const std::string& isoString); - static TemporalObject::DateTime parseTemporalDateString(ExecutionState& state, const std::string& isoString); - static TemporalObject::DateTime parseTemporalDateTimeString(ExecutionState& state, const std::string& isoString); - static std::map parseTemporalDurationString(ExecutionState& state, const std::string& isoString); - static TemporalObject::DateTime parseTemporalYearMonthString(ExecutionState& state, const std::string& isoString); - static TemporalObject::DateTime parseTemporalMonthDayString(ExecutionState& state, const std::string& isoString); - static TemporalObject::TimeZone parseTemporalTimeZoneString(ExecutionState& state, const std::string& isoString); - static std::string getNNumberFromString(ExecutionState& state, std::string& isoString, int n, unsigned int& index); - static std::map getSeconds(ExecutionState& state, std::string& isoString, unsigned int& index); static std::string offset(ExecutionState& state, std::string& isoString, unsigned int& index); - static std::string tzComponent(ExecutionState& state, std::string& isoString, unsigned int& index); - static TemporalObject::TimeZone parseTimeZoneOffset(ExecutionState& state, std::string& isoString, unsigned int& index); - static bool isNumber(const std::string& s) + + static Value getOptionsObject(ExecutionState& state, const Value& options) + { + if (options.isObject()) { + return options; + } + + if (!options.isUndefined()) { + ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, "options must be object"); + } + + return {}; + } + + static Value toTemporalOverflow(ExecutionState& state, const Value& normalizedOptions) + { + if (normalizedOptions.isUndefined()) { + return state.context()->staticStrings().lazyConstrain().string(); + } + auto options = normalizedOptions.toObject(state); + Value matcherValues[2] = { state.context()->staticStrings().lazyConstrain().string(), state.context()->staticStrings().reject.string() }; + return Intl::getOption(state, options, state.context()->staticStrings().lazyOverflow().string(), Intl::StringValue, matcherValues, 2, matcherValues[0]); + } + + static Value toTemporalDisambiguation(ExecutionState& state, const Value& options) { - return !s.empty() && std::find_if(s.begin(), s.end(), [](unsigned char c) { return !std::isdigit(c); }) == s.end(); + if (options.isUndefined()) { + return state.context()->staticStrings().lazyConstrain().string(); + } + + Value matcherValues[4] = { state.context()->staticStrings().lazyConstrain().string(), state.context()->staticStrings().lazyEarlier().string(), state.context()->staticStrings().lazyLater().string(), state.context()->staticStrings().reject.string() }; + return Intl::getOption(state, options.asObject(), state.context()->staticStrings().lazyDisambiguation().string(), Intl::StringValue, matcherValues, 4, matcherValues[0]); } - static Value toRelativeTemporalObject(ExecutionState& state, Object* options); - static Object* mergeLargestUnitOption(ExecutionState& state, const Value& option, TemporalObject::DateTimeUnits largestUnit); - static UnsignedRoundingMode getUnsignedRoundingMode(ExecutionState& state, RoundingMode roundingMode, bool isNegative); - static BigInt* roundNumberToIncrementAsIfPositive(ExecutionState& state, BigInt* x, int64_t increment, RoundingMode roundingMode); - static BigInt* applyUnsignedRoundingMode(ExecutionState& state, BigInt* x, BigInt* r1, BigInt* r2, UnsignedRoundingMode unsignedRoundingMode); - static int64_t floor(double num); - static int64_t modulo(int64_t num1, int64_t num2); + static Value toTemporalOffset(ExecutionState& state, const Value& options, const Value& fallback) + { + if (options.isUndefined()) { + return fallback; + } + + Value matcherValues[4] = { state.context()->staticStrings().lazyPrefer().string(), state.context()->staticStrings().lazyUse().string(), state.context()->staticStrings().lazyIgnore().string(), state.context()->staticStrings().reject.string() }; + return Intl::getOption(state, options.asObject(), state.context()->staticStrings().lazyOffset().string(), Intl::StringValue, matcherValues, 4, fallback); + } + + + static void rejectObjectWithCalendarOrTimeZone(ExecutionState& state, const Value& object) + { + ASSERT(object.isObject()); + + if (object.asObject()->isTemporalPlainDateObject() || object.asObject()->isTemporalPlainDateTimeObject() || object.asObject()->isTemporalPlainTimeObject() || object.asObject()->isTemporalZonedDateTimeObject() || object.asObject()->isTemporalPlainYearMonthObject() || object.asObject()->isTemporalMonthDayObject()) { + ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("Invalid type of Object")); + } + + if (!object.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().calendar.string())).value(state, object).isUndefined()) { + ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("Object has calendar property")); + } + + if (!object.asObject()->get(state, ObjectPropertyName(state, state.context()->staticStrings().lazyTimeZone().string())).value(state, object).isUndefined()) { + ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, new ASCIIString("Object has timezone property")); + } + } }; class TemporalCalendarObject : public TemporalObject {