Skip to content

Commit

Permalink
Bug 1920955 - Part 47: Remove ToCalendarValue and ToTemporalTimeZone …
Browse files Browse the repository at this point in the history
…from constructors. r=sfink

Still not done with the "Normative: Remove calendars and time zones" spec PR. The
constructors also no longer call `ToCalendarValue` or `ToTemporalTimeZone`.

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

UltraBlame original commit: d2fdb7e06acb78e3292b7e0948a5735dd66ff690
  • Loading branch information
marco-c committed Oct 9, 2024
1 parent cbd1723 commit 9e97b83
Show file tree
Hide file tree
Showing 5 changed files with 511 additions and 28 deletions.
87 changes: 83 additions & 4 deletions js/src/builtin/temporal/PlainDate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8683,8 +8683,10 @@ false
}
/
/
Step
Steps
5
-
8
.
Rooted
<
Expand All @@ -8693,20 +8695,96 @@ CalendarValue
calendar
(
cx
CalendarValue
(
CalendarId
:
:
ISO8601
)
)
;
if
(
args
.
hasDefined
(
3
)
)
{
/
/
Step
6
.
if
(
!
ToTemporalCalendarWithISODefault
args
[
3
]
.
isString
(
)
)
{
ReportValueError
(
cx
JSMSG_UNEXPECTED_TYPE
JSDVG_IGNORE_STACK
args
[
3
]
nullptr
"
not
a
string
"
)
;
return
false
;
}
/
/
Steps
7
-
8
.
get
Rooted
<
JSString
*
>
calendarString
(
cx
args
[
3
]
.
toString
(
)
)
;
if
(
!
ToBuiltinCalendar
(
cx
calendarString
&
calendar
)
Expand All @@ -8716,10 +8794,11 @@ return
false
;
}
}
/
/
Step
6
9
.
auto
*
Expand Down
87 changes: 83 additions & 4 deletions js/src/builtin/temporal/PlainDateTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6679,8 +6679,10 @@ false
}
/
/
Step
Steps
11
-
14
.
Rooted
<
Expand All @@ -6689,20 +6691,96 @@ CalendarValue
calendar
(
cx
CalendarValue
(
CalendarId
:
:
ISO8601
)
)
;
if
(
args
.
hasDefined
(
9
)
)
{
/
/
Step
12
.
if
(
!
ToTemporalCalendarWithISODefault
args
[
9
]
.
isString
(
)
)
{
ReportValueError
(
cx
JSMSG_UNEXPECTED_TYPE
JSDVG_IGNORE_STACK
args
[
9
]
nullptr
"
not
a
string
"
)
;
return
false
;
}
/
/
Steps
13
-
14
.
get
Rooted
<
JSString
*
>
calendarString
(
cx
args
[
9
]
.
toString
(
)
)
;
if
(
!
ToBuiltinCalendar
(
cx
calendarString
&
calendar
)
Expand All @@ -6712,10 +6790,11 @@ return
false
;
}
}
/
/
Step
12
15
.
auto
*
Expand Down
89 changes: 84 additions & 5 deletions js/src/builtin/temporal/PlainMonthDay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2172,8 +2172,10 @@ false
}
/
/
Step
Steps
5
-
8
.
Rooted
<
Expand All @@ -2182,20 +2184,96 @@ CalendarValue
calendar
(
cx
CalendarValue
(
CalendarId
:
:
ISO8601
)
)
;
if
(
args
.
hasDefined
(
2
)
)
{
/
/
Step
6
.
if
(
!
ToTemporalCalendarWithISODefault
args
[
2
]
.
isString
(
)
)
{
ReportValueError
(
cx
JSMSG_UNEXPECTED_TYPE
JSDVG_IGNORE_STACK
args
[
2
]
nullptr
"
not
a
string
"
)
;
return
false
;
}
/
/
Steps
7
-
8
.
get
Rooted
<
JSString
*
>
calendarString
(
cx
args
[
2
]
.
toString
(
)
)
;
if
(
!
ToBuiltinCalendar
(
cx
calendarString
&
calendar
)
Expand All @@ -2205,12 +2283,13 @@ return
false
;
}
}
/
/
Steps
2
and
6
9
.
double
isoYear
Expand Down Expand Up @@ -2253,7 +2332,7 @@ false
/
/
Step
7
10
.
auto
*
Expand Down
Loading

0 comments on commit 9e97b83

Please sign in to comment.