Skip to content

Commit

Permalink
Editorial: update deps and fix issues
Browse files Browse the repository at this point in the history
- Update all developer dependencies to their latest versions (including
major updates).
- Update files to conform to the new versions and fix some issues:
  - Enum values should be lowercase and kebab-case.
  - Avoid declaring variables that are already declared, either set
    their value or rename them accordingly.
  - Avoid using abrupt shorthands on abstract or syntax-directed
    operations that do not return a Completion Record.
  - Avoid calling abstract functions in algorithms that don't have a
    definition.
  - Update section names to their new ones.
  - Fix a small formatting issue.
  • Loading branch information
VoltrexKeyva authored and ptomato committed Jan 29, 2024
1 parent 116788b commit 35732cb
Show file tree
Hide file tree
Showing 17 changed files with 837 additions and 2,880 deletions.
4 changes: 1 addition & 3 deletions docs/buildDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ async function go() {
);
// copy /docs/assets/* to /out/docs/assets/
await Promise.all(
(
await fs.readdir('assets')
).map((file) => {
(await fs.readdir('assets')).map((file) => {
return fs.copyFile(path.resolve('assets', file), path.resolve('../out/docs/assets', file));
})
);
Expand Down
3,264 changes: 626 additions & 2,638 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
},
"main": "polyfill/lib/index.mjs",
"devDependencies": {
"@tc39/ecma262-biblio": "=2.1.2577",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"ecmarkup": "^17.0.1",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"@tc39/ecma262-biblio": "=2.1.2663",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"ecmarkup": "^18.1.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.2",
"mkdirp": "^3.0.1",
"prettier": "^2.8.8",
"typescript": "^5.1.3"
"prettier": "^3.1.1",
"typescript": "^5.3.3"
},
"scripts": {
"test": "cd polyfill && npm install && npm test && npm run test-cookbook && npm run test262",
Expand Down
42 changes: 21 additions & 21 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h1>Date Equations</h1>
<p>The weekday for a particular time _t_ is defined as:</p>
<emu-eqn id="eqn-epochtimetoweekday" aoid="EpochTimeToWeekDay">EpochTimeToWeekDay(_t_) =(EpochTimeToDayNumber(_t_) + 4) modulo 7</emu-eqn>
<p>A weekday value of 0 specifies Sunday; 1 specifies Monday; 2 specifies Tuesday; 3 specifies Wednesday; 4 specifies Thursday; 5 specifies Friday; and 6 specifies Saturday. Note that <emu-eqn>EpochTimeToWeekDay(0) = 4</emu-eqn>, corresponding to Thursday, 1 January 1970.</p>
<emu-note type="editor"> These equations correspond to ECMA-262 equations defined in <emu-xref href="#sec-year-number">Year Number</emu-xref>, <emu-xref href="#sec-month-number">Month Number</emu-xref>, <emu-xref href="#sec-date-number">Date Number</emu-xref>, <emu-xref href="#sec-week-day">Week Day</emu-xref> respectively. These calculate the result in mathematical values instead of Number values. These equations would be unified when https://github.com/tc39/ecma262/issues/1087 is fixed.</emu-note>
<emu-note type="editor"> These equations correspond to ECMA-262 equations defined in <emu-xref href="#sec-daysinyear">Days in Year</emu-xref>, <emu-xref href="#sec-monthfromtime">Month from Time</emu-xref>, <emu-xref href="#sec-datefromtime">Date from Time</emu-xref>, <emu-xref href="#sec-weekday">Week Day</emu-xref> respectively. These calculate the result in mathematical values instead of Number values. These equations would be unified when https://github.com/tc39/ecma262/issues/1087 is fixed.</emu-note>
<emu-note type="editor"> Note that the operation EpochTimeToMonthInYear(_t_) uses 0-based months unlike rest of Temporal since it's intended to be unified with MonthFromTime(_t_) when the above mentioned issue is fixed.</emu-note>
</emu-clause>
<!-- Copied from ECMA-402 GetOptionsObject -->
Expand Down Expand Up @@ -730,18 +730,18 @@ <h1>
1. Let _value_ be ? Get(_options_, *"relativeTo"*).
1. If _value_ is *undefined*, return the Record { [[PlainRelativeTo]]: *undefined*, [[ZonedRelativeTo]]: *undefined*, [[TimeZoneRec]]: *undefined* }.
1. Let _offsetBehaviour_ be ~option~.
1. Let _matchBehaviour_ be ~match exactly~.
1. Let _matchBehaviour_ be ~match-exactly~.
1. If Type(_value_) is Object, then
1. If _value_ has an [[InitializedTemporalZonedDateTime]] internal slot, then
1. Let _timeZoneRec_ be ? CreateTimeZoneMethodsRecord(_value_.[[TimeZone]], « ~getOffsetNanosecondsFor~, ~getPossibleInstantsFor~ »).
1. Let _timeZoneRec_ be ? CreateTimeZoneMethodsRecord(_value_.[[TimeZone]], « ~get-offset-nanoseconds-for~, ~get-possible-instants-for~ »).
1. Return the Record { [[PlainRelativeTo]]: *undefined*, [[ZonedRelativeTo]]: _value_, [[TimeZoneRec]]: _timeZoneRec_ }.
1. If _value_ has an [[InitializedTemporalDate]] internal slot, then
1. Return the Record { [[PlainRelativeTo]]: _value_, [[ZonedRelativeTo]]: *undefined*, [[TimeZoneRec]]: *undefined* }.
1. If _value_ has an [[InitializedTemporalDateTime]] internal slot, then
1. Let _plainDate_ be ! CreateTemporalDate(_value_.[[ISOYear]], _value_.[[ISOMonth]], _value_.[[ISODay]], _value_.[[Calendar]]).
1. Return the Record { [[PlainRelativeTo]]: _plainDate_, [[ZonedRelativeTo]]: *undefined*, [[TimeZoneRec]]: *undefined* }.
1. Let _calendar_ be ? GetTemporalCalendarSlotValueWithISODefault(_value_).
1. Let _calendarRec_ be ? CreateCalendarMethodsRecord(_calendar_, « ~dateFromFields~, ~fields~ »).
1. Let _calendarRec_ be ? CreateCalendarMethodsRecord(_calendar_, « ~date-from-fields~, ~fields~ »).
1. Let _fieldNames_ be ? CalendarFields(_calendarRec_, « *"day"*, *"month"*, *"monthCode"*, *"year"* »).
1. Append *"hour"*, *"microsecond"*, *"millisecond"*, *"minute"*, *"nanosecond"*, *"offset"*, *"second"*, and *"timeZone"* to _fieldNames_.
1. Let _fields_ be ? PrepareTemporalFields(_value_, _fieldNames_, «»).
Expand All @@ -767,7 +767,7 @@ <h1>
1. Set _offsetBehaviour_ to ~exact~.
1. Else if _offsetString_ is *undefined*, then
1. Set _offsetBehaviour_ to ~wall~.
1. Set _matchBehaviour_ to ~match minutes~.
1. Set _matchBehaviour_ to ~match-minutes~.
1. Let _calendar_ be _result_.[[Calendar]].
1. If _calendar_ is *undefined*, set _calendar_ to *"iso8601"*.
1. If IsBuiltinCalendar(_calendar_) is *false*, throw a *RangeError* exception.
Expand All @@ -779,7 +779,7 @@ <h1>
1. Let _offsetNs_ be ? ParseDateTimeUTCOffset(_offsetString_).
1. Else,
1. Let _offsetNs_ be 0.
1. Let _timeZoneRec_ be ? CreateTimeZoneMethodsRecord(_timeZone_, « ~getOffsetNanosecondsFor~, ~getPossibleInstantsFor~ »).
1. Let _timeZoneRec_ be ? CreateTimeZoneMethodsRecord(_timeZone_, « ~get-offset-nanoseconds-for~, ~get-possible-instants-for~ »).
1. Let _epochNanoseconds_ be ? InterpretISODateTimeOffset(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]], _result_.[[Hour]], _result_.[[Minute]], _result_.[[Second]], _result_.[[Millisecond]], _result_.[[Microsecond]], _result_.[[Nanosecond]], _offsetBehaviour_, _offsetNs_, _timeZoneRec_, *"compatible"*, *"reject"*, _matchBehaviour_).
1. Let _zonedRelativeTo_ be ! CreateTemporalZonedDateTime(_epochNanoseconds_, _timeZone_, _calendar_).
1. Return the Record { [[PlainRelativeTo]]: *undefined*, [[ZonedRelativeTo]]: _zonedRelativeTo_, [[TimeZoneRec]]: _timeZoneRec_ }.
Expand Down Expand Up @@ -1572,7 +1572,7 @@ <h1>
1. If CodePointsToString(_key_) is *"u-ca"*, then
1. If _calendar_ is *undefined*, then
1. Let _value_ be the source text matched by the |AnnotationValue| Parse Node contained within _annotation_.
1. Let _calendar_ be CodePointsToString(_value_).
1. Set _calendar_ to CodePointsToString(_value_).
1. If _annotation_ contains an |AnnotationCriticalFlag| Parse Node, set _calendarWasCritical_ to *true*.
1. Else,
1. If _annotation_ contains an |AnnotationCriticalFlag| Parse Node, or _calendarWasCritical_ is *true*, throw a *RangeError* exception.
Expand Down Expand Up @@ -1982,14 +1982,14 @@ <h1>
1. Set _any_ to *true*.
1. If _property_ is in the Property column of <emu-xref href="#table-temporal-field-requirements"></emu-xref> and there is a Conversion value in the same row, then
1. Let _Conversion_ be the Conversion value of the same row.
1. If _Conversion_ is ~ToIntegerWithTruncation~, then
1. If _Conversion_ is ~to-integer-with-truncation~, then
1. Set _value_ to ? ToIntegerWithTruncation(_value_).
1. Set _value_ to 𝔽(_value_).
1. Else if _Conversion_ is ~ToPositiveIntegerWithTruncation~, then
1. Else if _Conversion_ is ~to-positive-integer-with-truncation~, then
1. Set _value_ to ? ToPositiveIntegerWithTruncation(_value_).
1. Set _value_ to 𝔽(_value_).
1. Else,
1. Assert: _Conversion_ is ~ToPrimitiveAndRequireString~.
1. Assert: _Conversion_ is ~to-primitive-and-require-string~.
1. NOTE: Non-primitive values are supported here for consistency with other fields, but such values must coerce to Strings.
1. Set _value_ to ? ToPrimitive(_value_, ~string~).
1. If _value_ is not a String, throw a *TypeError* exception.
Expand Down Expand Up @@ -2023,57 +2023,57 @@ <h1>
<tbody>
<tr>
<td>*"year"*</td>
<td>~ToIntegerWithTruncation~</td>
<td>~to-integer-with-truncation~</td>
<td>*undefined*</td>
</tr>
<tr>
<td>*"month"*</td>
<td>~ToPositiveIntegerWithTruncation~</td>
<td>~to-positive-integer-with-truncation~</td>
<td>*undefined*</td>
</tr>
<tr>
<td>*"monthCode"*</td>
<td>~ToPrimitiveAndRequireString~</td>
<td>~to-primitive-and-require-string~</td>
<td>*undefined*</td>
</tr>
<tr>
<td>*"day"*</td>
<td>~ToPositiveIntegerWithTruncation~</td>
<td>~to-positive-integer-with-truncation~</td>
<td>*undefined*</td>
</tr>
<tr>
<td>*"hour"*</td>
<td>~ToIntegerWithTruncation~</td>
<td>~to-integer-with-truncation~</td>
<td>*+0*<sub>𝔽</sub></td>
</tr>
<tr>
<td>*"minute"*</td>
<td>~ToIntegerWithTruncation~</td>
<td>~to-integer-with-truncation~</td>
<td>*+0*<sub>𝔽</sub></td>
</tr>
<tr>
<td>*"second"*</td>
<td>~ToIntegerWithTruncation~</td>
<td>~to-integer-with-truncation~</td>
<td>*+0*<sub>𝔽</sub></td>
</tr>
<tr>
<td>*"millisecond"*</td>
<td>~ToIntegerWithTruncation~</td>
<td>~to-integer-with-truncation~</td>
<td>*+0*<sub>𝔽</sub></td>
</tr>
<tr>
<td>*"microsecond"*</td>
<td>~ToIntegerWithTruncation~</td>
<td>~to-integer-with-truncation~</td>
<td>*+0*<sub>𝔽</sub></td>
</tr>
<tr>
<td>*"nanosecond"*</td>
<td>~ToIntegerWithTruncation~</td>
<td>~to-integer-with-truncation~</td>
<td>*+0*<sub>𝔽</sub></td>
</tr>
<tr>
<td>*"offset"*</td>
<td>~ToPrimitiveAndRequireString~</td>
<td>~to-primitive-and-require-string~</td>
<td>*undefined*</td>
</tr>
<tr>
Expand Down
29 changes: 0 additions & 29 deletions spec/biblio.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
[
{
"location": "https://tc39.es/ecma262",
"comment": "Temporary. See https://github.com/tc39/proposal-temporal/pull/2746",
"entries": [
{
"type": "op",
"aoid": "MakeFullYear",
"refId": "sec-makefullyear",
"kind": "abstract operation",
"signature": {
"parameters": [
{
"name": "_year_",
"type": {
"kind": "opaque",
"type": "a Number"
}
}
],
"optionalParameters": [],
"return": {
"kind": "opaque",
"type": "an integral Number or *NaN*"
}
},
"effects": []
}
]
},
{
"location": "https://tc39.es/ecma402/",
"entries": [
Expand Down
Loading

0 comments on commit 35732cb

Please sign in to comment.