Skip to content

Commit e40f90c

Browse files
committed
update jsc version resolution on linux
1 parent f874238 commit e40f90c

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ installing engines to make eshost automatically find the installed engines.
3535
| [engine262][] | `engine262` ||||||
3636
| [GraalJS][] | `graaljs` || || ||
3737
| [Hermes][] | `hermes` || | | ||
38-
| [JavaScriptCore][] | `jsc`, `javascriptcore` || ||||
38+
| [JavaScriptCore][] | `jsc`, `javascriptcore` || ||||
3939
| [QuickJS][] | `quickjs`, `quickjs-run-test262` | | || | |
4040
| [SpiderMonkey][] | `sm`, `spidermonkey` ||||||
4141
| [V8][] | `v8` ||||||

src/engines/javascriptcore.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,10 @@ class JavaScriptCoreInstaller extends Installer {
3939
static async resolveVersion(version) {
4040
if (version === 'latest') {
4141
switch (platform) {
42-
case 'linux32':
43-
case 'linux64': {
44-
const body = await fetch(`https://webkitgtk.org/jsc-built-products/x86_${platform === 'linux32' ? '32' : '64'}/release/?C=M;O=D`)
45-
.then((r) => r.text());
46-
// Check for the most recent *.sha256sum file rather than the
47-
// most recent *.zip file to avoid the race condition where the
48-
// ZIP file has not fully been uploaded yet. The *.sha256sum
49-
// files are written last, so once one is available the
50-
// corresponding ZIP file is guaranteed to be available.
51-
// https://mths.be/bww
52-
const match = /<a href="(\d+)\.sha256sum">/.exec(body);
53-
return match[1];
54-
}
42+
case 'linux64':
43+
return fetch('https://webkitgtk.org/jsc-built-products/x86_64/release/LAST-IS')
44+
.then((r) => r.text())
45+
.then((n) => n.trim().replace('.zip', ''));
5546
case 'win32': {
5647
const body = await fetch('https://build.webkit.org/builders/Apple%20Win%2010%20Release%20(Build)?numbuilds=25')
5748
.then((r) => r.text());
@@ -153,7 +144,7 @@ JavaScriptCoreInstaller.config = {
153144
},
154145
] : undefined,
155146
supported: [
156-
'linux32', 'linux64',
147+
'linux64',
157148
'win32', 'win64',
158149
'darwin64',
159150
],

0 commit comments

Comments
 (0)