-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Test262 tests against production artifacts.
- Loading branch information
Showing
9 changed files
with
118 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ tsc-out/ | |
.vscode/* | ||
!.vscode/launch.json | ||
*.tgz | ||
test/tc39 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ types | |
tsconfig.json | ||
*.sh | ||
.vscode | ||
dist/script.js | ||
dist/playground.cjs |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// This is an alternate entry point that polyfills Temporal onto the global | ||
// object. This is used only for the browser playground and the test262 tests. | ||
// See the note in index.mjs. | ||
|
||
import * as Temporal from './temporal'; | ||
import * as Intl from './intl'; | ||
import { toTemporalInstant } from './legacydate'; | ||
|
||
Object.defineProperty(globalThis, 'Temporal', { | ||
value: {}, | ||
writable: true, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
copy(globalThis.Temporal, Temporal); | ||
Object.defineProperty(globalThis.Temporal, Symbol.toStringTag, { | ||
value: 'Temporal', | ||
writable: false, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
copy(globalThis.Temporal.Now, Temporal.Now); | ||
copy(globalThis.Intl, Intl); | ||
Object.defineProperty(globalThis.Date.prototype, 'toTemporalInstant', { | ||
value: toTemporalInstant, | ||
writable: true, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
|
||
function copy(target, source) { | ||
for (const prop of Object.getOwnPropertyNames(source)) { | ||
Object.defineProperty(target, prop, { | ||
value: source[prop], | ||
writable: true, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
} | ||
} | ||
|
||
export { Temporal, Intl, toTemporalInstant }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -e | ||
cd "$(dirname "$0")" | ||
if [ ! -d "tc39" ]; then | ||
git clone --depth=1 https://github.com/tc39/proposal-temporal.git tc39 | ||
else | ||
cd ./tc39 | ||
git fetch origin | ||
git merge --ff-only origin/main | ||
fi | ||
|
||
cd ../ && TEST262=1 npm run build | ||
cd tc39/polyfill && npm install | ||
if [ ! -z "$TESTS" ]; then | ||
PRELUDE=../../../dist/script.js npm run test262 "$TESTS" | ||
else | ||
PRELUDE=../../../dist/script.js npm run test262 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters