Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor TemporalObject #1407

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
666 changes: 333 additions & 333 deletions src/builtins/BuiltinTemporal.cpp

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions src/runtime/GlobalObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
2 changes: 0 additions & 2 deletions src/runtime/StaticStrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
156 changes: 79 additions & 77 deletions src/runtime/StaticStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -1049,8 +1053,6 @@ class StaticStrings {
AtomicString symbolReplace;
AtomicString symbolSearch;
AtomicString symbolSplit;
AtomicString temporalDotNow;
AtomicString temporalDotPlainDate;

#if defined(ENABLE_WASM)
AtomicString getExports;
Expand Down
Loading
Loading