Skip to content

Commit

Permalink
Bug 1840374 - Part 19: Rename RejectObjectWithCalendarOrTimeZone to R…
Browse files Browse the repository at this point in the history
…ejectTemporalLikeObject. r=spidermonkey-reviewers,allstarschh

Rename per <tc39/proposal-temporal#2482>.

Depends on D182036

Differential Revision: https://phabricator.services.mozilla.com/D182038

UltraBlame original commit: 4bb3d334eaacf0084e325b1b85d1352f9fd44051
  • Loading branch information
marco-c committed Jul 21, 2023
1 parent 4aeff8e commit edce36a
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion js/src/builtin/temporal/PlainDate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2057,7 +2057,7 @@ static bool PlainDate_with(JSContext* cx, const CallArgs& args) {
}


if (!RejectObjectWithCalendarOrTimeZone(cx, temporalDateLike)) {
if (!RejectTemporalLikeObject(cx, temporalDateLike)) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/temporal/PlainDateTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ static bool PlainDateTime_with(JSContext* cx, const CallArgs& args) {
}


if (!RejectObjectWithCalendarOrTimeZone(cx, temporalDateTimeLike)) {
if (!RejectTemporalLikeObject(cx, temporalDateTimeLike)) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/temporal/PlainMonthDay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ static bool PlainMonthDay_with(JSContext* cx, const CallArgs& args) {
}


if (!RejectObjectWithCalendarOrTimeZone(cx, temporalMonthDayLike)) {
if (!RejectTemporalLikeObject(cx, temporalMonthDayLike)) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/temporal/PlainTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ static bool PlainTime_with(JSContext* cx, const CallArgs& args) {
}


if (!RejectObjectWithCalendarOrTimeZone(cx, temporalTimeLike)) {
if (!RejectTemporalLikeObject(cx, temporalTimeLike)) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/temporal/PlainYearMonth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ static bool PlainYearMonth_with(JSContext* cx, const CallArgs& args) {
}


if (!RejectObjectWithCalendarOrTimeZone(cx, temporalYearMonthLike)) {
if (!RejectTemporalLikeObject(cx, temporalYearMonthLike)) {
return false;
}

Expand Down
9 changes: 4 additions & 5 deletions js/src/builtin/temporal/Temporal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1517,10 +1517,8 @@ static JSObject* MaybeUnwrapIf(JSObject* object) {



bool js::temporal::RejectObjectWithCalendarOrTimeZone(
JSContext* cx, Handle<JSObject*> object) {


bool js::temporal::RejectTemporalLikeObject(JSContext* cx,
Handle<JSObject*> object) {

if (auto* unwrapped =
MaybeUnwrapIf<PlainDateObject, PlainDateTimeObject,
Expand Down Expand Up @@ -1558,6 +1556,7 @@ bool js::temporal::RejectObjectWithCalendarOrTimeZone(
return false;
}


return true;
}

Expand Down Expand Up @@ -1885,7 +1884,7 @@ bool js::temporal::GetDifferenceSettings(
}

static JSObject* CreateTemporalObject(JSContext* cx, JSProtoKey key) {
RootedObject proto(cx, &cx->global()->getObjectPrototype());
Rooted<JSObject*> proto(cx, &cx->global()->getObjectPrototype());



Expand Down
5 changes: 1 addition & 4 deletions js/src/builtin/temporal/Temporal.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ bool ToCalendarNameOption(JSContext* cx, JS::Handle<JSObject*> options,





class Precision final {
int8_t value_;

Expand Down Expand Up @@ -328,8 +326,7 @@ bool ToShowOffsetOption(JSContext* cx, JS::Handle<JSObject*> options,



bool RejectObjectWithCalendarOrTimeZone(JSContext* cx,
JS::Handle<JSObject*> object);
bool RejectTemporalLikeObject(JSContext* cx, JS::Handle<JSObject*> object);



Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/temporal/TemporalNow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ static const JSPropertySpec TemporalNow_properties[] = {
};

static JSObject* CreateTemporalNowObject(JSContext* cx, JSProtoKey key) {
RootedObject proto(cx, &cx->global()->getObjectPrototype());
Rooted<JSObject*> proto(cx, &cx->global()->getObjectPrototype());
return NewTenuredObjectWithGivenProto(cx, &TemporalNowObject::class_, proto);
}

Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/temporal/ZonedDateTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2560,7 +2560,7 @@ static bool ZonedDateTime_with(JSContext* cx, const CallArgs& args) {
}


if (!RejectObjectWithCalendarOrTimeZone(cx, temporalZonedDateTimeLike)) {
if (!RejectTemporalLikeObject(cx, temporalZonedDateTimeLike)) {
return false;
}

Expand Down

0 comments on commit edce36a

Please sign in to comment.