Skip to content
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
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: use node.js v20.x
- name: use node.js v23.x
uses: actions/setup-node@v3
with:
node-version: 20.x
node-version: 23.x
- run: npm ci
- run: npm run test-demitasse
env:
Expand All @@ -23,10 +23,10 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: use node.js v20.x
- name: use node.js v23.x
uses: actions/setup-node@v3
with:
node-version: 20.x
node-version: 23.x
- run: npm run codecov:test262
- uses: codecov/codecov-action@v4
with:
Expand All @@ -38,20 +38,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: use node.js v20.x
- name: use node.js v23.x
uses: actions/setup-node@v3
with:
node-version: 20.x
node-version: 23.x
- run: npm ci
- run: npm run test-cookbook
test-validstrings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: use node.js v20.x
- name: use node.js v23.x
uses: actions/setup-node@v3
with:
node-version: 20.x
node-version: 23.x
- run: npm ci
- run: |
cd polyfill
Expand Down
12 changes: 6 additions & 6 deletions polyfill/lib/intl.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ function createDateTimeFormat(dtf, locale, options) {
SetSlot(dtf, TZ_ORIGINAL, ro.timeZone);
} else {
const id = ES.ToString(timeZoneOption);
if (ES.IsOffsetTimeZoneIdentifier(id)) {
// Note: https://github.com/tc39/ecma402/issues/683 will remove this
throw new RangeErrorCtor('Intl.DateTimeFormat does not currently support offset time zones');
if (id.startsWith('−')) {
// The initial (Node 23) implementation of offset time zones allowed use
// of the Unicode minus sign, which was disallowed by a later spec change.
throw new RangeError('Unicode minus (U+2212) is not supported in time zone offsets');
}
const record = ES.GetAvailableNamedTimeZoneIdentifier(id);
if (!record) throw new RangeErrorCtor(`Intl.DateTimeFormat formats built-in time zones, not ${id}`);
SetSlot(dtf, TZ_ORIGINAL, record.identifier);
// store a normalized identifier
SetSlot(dtf, TZ_ORIGINAL, ES.ToTemporalTimeZoneIdentifier(id));
}
}

Expand Down
4 changes: 2 additions & 2 deletions polyfill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"browser": "dist/index.umd.js",
"types": "index.d.ts",
"scripts": {
"test": "node --loader ./test/resolve.source.mjs ./test/all.mjs",
"test": "node ./test/all.mjs",
"test-cookbook": "npm run build && TEST=all npm run test-cookbook-one",
"test-cookbook-one": "node --loader ./test/resolve.cookbook.mjs ../docs/cookbook/$TEST.mjs",
"test-cookbook-one": "node --require=./script.js --eval='globalThis.assert = require(`node:assert`).strict' ../docs/cookbook/$TEST.mjs",
"test262": "npm run build262 && node runtest262.mjs",
"codecov:test262": "./ci_codecov_test262.sh",
"build": "rollup -c rollup.config.js --bundleConfigAsCjs",
Expand Down
2 changes: 1 addition & 1 deletion polyfill/test/datemath.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { reporter } = Pretty;
import { strict as assert } from 'assert';
const { equal } = assert;

import * as Temporal from 'proposal-temporal';
import * as Temporal from '../lib/temporal.mjs';

describe('Date.since(simple, simple)', () => {
build('Before Leap Day', '2020-01-03', '2020-02-15');
Expand Down
1 change: 0 additions & 1 deletion polyfill/test/ecmascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const { deepEqual, equal, throws } = assert;
import bigInt from 'big-integer';
import { readFileSync } from 'fs';

import 'proposal-temporal';
import * as ES from '../lib/ecmascript.mjs';

describe('ECMAScript', () => {
Expand Down
17 changes: 2 additions & 15 deletions polyfill/test/expected-failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,14 @@ staging/Intl402/Temporal/old/time-toLocaleString.js
intl402/DateTimeFormat/prototype/format/temporal-objects-resolved-time-zone.js
intl402/DateTimeFormat/prototype/format/timedatestyle-en.js

# These are caught by the default test glob, but are unrelated to Temporal.
# They rely on Intl.DateTimeFormat supporting offset time zones.
intl402/DateTimeFormat/prototype/format/offset-timezone-gmt-same.js
intl402/DateTimeFormat/prototype/formatToParts/offset-timezone-correct.js
intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-basic.js
intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js

# Temporal test262 runner does not support $262.createRealm()
intl402/DateTimeFormat/proto-from-ctor-realm.js

# https://github.com/tc39/ecma402/issues/402
intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js

# Fails until CLDR 46 (released 2024-10-24) makes its way into a Node.js release
staging/Intl402/Temporal/old/non-iso-calendars.js

# https://github.com/tc39/test262/pull/4336
intl402/DateTimeFormat/canonicalize-utc-timezone.js
# https://github.com/tc39/ecma402/issues/534
staging/Intl402/Temporal/old/non-iso-calendars-ethiopic.js

# Possibly faulty calculations for year 0 in Hebrew calendar in ICU4C
# https://unicode-org.atlassian.net/browse/ICU-23007
Expand All @@ -37,6 +27,3 @@ staging/sm/Temporal/PlainDate/from-islamic-umalqura.js
# Faulty leap month calculations in Chinese calendar in ICU4C
# https://unicode-org.atlassian.net/browse/ICU-22230
staging/sm/Temporal/PlainMonthDay/from-chinese-leap-month-uncommon.js

# Fails until Intl.DurationFormat available in Node.js release
intl402/Temporal/Duration/prototype/toLocaleString/returns-same-results-as-DurationFormat.js
14 changes: 0 additions & 14 deletions polyfill/test/resolve.cookbook.mjs

This file was deleted.

13 changes: 0 additions & 13 deletions polyfill/test/resolve.source.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion polyfill/test262
Submodule test262 updated 171 files