Skip to content

Commit 7cd49f6

Browse files
committed
Update polyfill and tests
1 parent 9115efd commit 7cd49f6

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed

polyfill/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ The full surface area of this proposal is expected to be covered by Test262 test
2020
- [x] DONE Add lightweight "Demitasse" tests in [test/canonicaltz.mjs](./test/canonicaltz.mjs) that cover this proposal's full surface area
2121
- [x] DONE Fix 15 existing Test262 tests that were broken by this proposal, because they assumed that time zone identifiers are always canonicalized
2222
- [x] DONE Open a Test262 draft PR
23-
- [ ] Migrate `Temporal.TimeZone.p.equals` (the only new API in this proposal) Demitasse tests to Test262
24-
- [ ] Migrate `Temporal.TimeZone` Demitasse tests to Test262
23+
- [x] Migrate `Temporal.TimeZone.p.equals` (the only new API in this proposal) Demitasse tests to Test262
24+
- [x] Migrate `Temporal.TimeZone` Demitasse tests to Test262
2525
- [ ] Migrate `Temporal.ZonedDateTime` Demitasse tests to Test262
2626
- [ ] Migrate `Intl.DateTimeFormat` Demitasse tests to Test262
2727
- [ ] Remove Demitasse tests from this repo and from CI workflows

polyfill/polyfill.diff

+31-5
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ index 244067cb..d4b6f741 100644
2121
getOffsetStringFor(instant: Temporal.Instant | string): string;
2222
getPlainDateTimeFor(instant: Temporal.Instant | string, calendar?: CalendarLike): Temporal.PlainDateTime;
2323
diff --git a/polyfill/lib/ecmascript.mjs b/polyfill/lib/ecmascript.mjs
24-
index 6b2a318d..bf86bda9 100644
24+
index adbb9d2e..47803e67 100644
2525
--- a/polyfill/lib/ecmascript.mjs
2626
+++ b/polyfill/lib/ecmascript.mjs
27-
@@ -370,7 +370,7 @@ export function ParseTemporalTimeZone(stringIdent) {
27+
@@ -371,7 +371,7 @@ export function ParseTemporalTimeZone(stringIdent) {
2828
if (IsTimeZoneOffsetString(tzName)) return CanonicalizeTimeZoneOffsetString(tzName);
2929
const record = GetAvailableNamedTimeZoneIdentifier(tzName);
3030
if (!record) throw new RangeError(`Unrecognized time zone ${tzName}`);
@@ -33,7 +33,7 @@ index 6b2a318d..bf86bda9 100644
3333
}
3434
if (z) return 'UTC';
3535
// if !tzName && !z then offset must be present
36-
@@ -2118,7 +2118,16 @@ export function TimeZoneEquals(one, two) {
36+
@@ -2119,7 +2119,16 @@ export function TimeZoneEquals(one, two) {
3737
if (one === two) return true;
3838
const tz1 = ToTemporalTimeZoneIdentifier(one);
3939
const tz2 = ToTemporalTimeZoneIdentifier(two);
@@ -102,10 +102,36 @@ index 1a593c7f..06de9d5f 100644
102102
}
103103

104104
const formatter = new DateTimeFormat(locales, optionsCopy);
105+
diff --git a/polyfill/package.json b/polyfill/package.json
106+
index 0cc84100..94128825 100644
107+
--- a/polyfill/package.json
108+
+++ b/polyfill/package.json
109+
@@ -10,7 +10,7 @@
110+
"test": "node --loader ./test/resolve.source.mjs ./test/all.mjs",
111+
"test-cookbook": "npm run build && TEST=all npm run test-cookbook-one && TEST=stockExchangeTimeZone npm run test-cookbook-one",
112+
"test-cookbook-one": "node --loader ./test/resolve.cookbook.mjs ../docs/cookbook/$TEST.mjs",
113+
- "test262": "npm run build262 && TIMEOUT=30000 node runtest262.mjs",
114+
+ "test262": "npm run build262 && node runtest262.mjs",
115+
"codecov:test262": "./ci_codecov_test262.sh",
116+
"build": "rollup -c rollup.config.js --bundleConfigAsCjs",
117+
"build262": "TEST262=1 rollup -c rollup.config.js --bundleConfigAsCjs",
118+
diff --git a/polyfill/runtest262.mjs b/polyfill/runtest262.mjs
119+
index e944bb6f..f4d90ecd 100644
120+
--- a/polyfill/runtest262.mjs
121+
+++ b/polyfill/runtest262.mjs
122+
@@ -4,7 +4,7 @@ const result = runTest262({
123+
test262Dir: 'test262',
124+
polyfillCodeFile: 'script.js',
125+
expectedFailureFiles: ['test/expected-failures.txt'],
126+
- timeoutMsecs: process.env.TIMEOUT,
127+
+ timeoutMsecs: process.env.TIMEOUT || 30000,
128+
testGlobs: process.argv.slice(2)
129+
});
130+
105131
diff --git a/polyfill/test262 b/polyfill/test262
106-
index 3e858ef0..be8f7e90 160000
132+
index 3e858ef0..ad8a846b 160000
107133
--- a/polyfill/test262
108134
+++ b/polyfill/test262
109135
@@ -1 +1 @@
110136
-Subproject commit 3e858ef02d2eda1e1e7eeff89ad7deeaf99d2766
111-
+Subproject commit be8f7e90217da86f3949d8ece80dc5ae3d990165
137+
+Subproject commit ad8a846bb8fb14912e755a4d4f2616e37f6eaa41

refresh_polyfill_code.sh

-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ if [ -n "$CI" ]; then
2121
fi
2222
else
2323
# When running outside CI, validate that the polyfill still builds
24-
cd tenporal/polyfill
2524
npm run build
2625
fi

0 commit comments

Comments
 (0)