Skip to content

Commit

Permalink
Bug 1840374 - Part 41: Sync spec references in Temporal parsing. r=sp…
Browse files Browse the repository at this point in the history
…idermonkey-reviewers,mgaudet

Implement the changes from
- tc39/proposal-temporal#2600
- tc39/proposal-temporal#2604
- tc39/proposal-temporal#2606

Also moves `annotationValueComponent()` into the class, because it's both
simpler and faster than the previous implementation.

Depends on D182060

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

UltraBlame original commit: 2de7da340caaad8e668a54faa44ec24696453005
  • Loading branch information
marco-c committed Jul 21, 2023
1 parent 57ee00f commit 5aa5605
Showing 1 changed file with 44 additions and 54 deletions.
98 changes: 44 additions & 54 deletions js/src/builtin/temporal/TemporalParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3234,32 +3234,52 @@ true
;
}
bool
aValChar
annotationValueComponent
(
)
{
if
size_t
index
=
reader_
.
index
(
!
)
;
size_t
i
=
0
;
for
(
;
index
+
i
<
reader_
.
hasMore
length
(
1
)
;
i
+
+
)
{
return
false
;
}
CharT
auto
ch
=
reader_
.
current
at
(
index
+
i
)
;
if
Expand All @@ -3274,6 +3294,18 @@ ch
)
)
{
break
;
}
}
if
(
i
=
=
0
)
{
return
false
;
Expand All @@ -3282,7 +3314,7 @@ reader_
.
advance
(
1
i
)
;
return
Expand Down Expand Up @@ -3599,11 +3631,6 @@ timeZoneIANAName
(
)
;
bool
annotationValueComponent
(
)
;
mozilla
:
:
Expand Down Expand Up @@ -8474,43 +8501,6 @@ template
typename
CharT
>
bool
TemporalParser
<
CharT
>
:
:
annotationValueComponent
(
)
{
bool
hasOne
=
false
;
while
(
aValChar
(
)
)
{
hasOne
=
true
;
}
return
hasOne
;
}
template
<
typename
CharT
>
mozilla
:
:
Expand Down

0 comments on commit 5aa5605

Please sign in to comment.