Skip to content

Commit b0c3638

Browse files
authored
Simplify error message from #25408. NFC (#25422)
Without this change it might appear that this is where the check/enforcement is happening, but its actually done by the feature_matrix.
1 parent fcb85d8 commit b0c3638

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/lib/libpthread.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#if EVAL_CTORS
2323
#error "EVAL_CTORS is not compatible with pthreads yet (passive segments)"
2424
#endif
25+
#if EXPORT_ES6 && (MIN_FIREFOX_VERSION < 114 || MIN_CHROME_VERSION < 80 || MIN_SAFARI_VERSION < 150000)
26+
#error "internal error, feature_matrix should not allow this"
27+
#endif
2528

2629
{{{
2730
#if MEMORY64
@@ -42,15 +45,6 @@ const pthreadWorkerScript = TARGET_JS_NAME;
4245
// See https://github.com/emscripten-core/emscripten/issues/22394
4346
const pthreadWorkerOptions = `{
4447
#if EXPORT_ES6
45-
#if MIN_FIREFOX_VERSION < 114
46-
#error new Worker() supports ECMAScript module only starting from Firefox 114. Pass -sMIN_FIREFOX_VERSION=114 to target -sEXPORT_ES6 with -pthread. See https://caniuse.com/mdn-api_worker_worker_ecmascript_modules
47-
#endif
48-
#if MIN_CHROME_VERSION < 80
49-
#error new Worker() supports ECMAScript module only starting from Chrome 80. Pass -sMIN_CHROME_VERSION=80 to target -sEXPORT_ES6 with -pthread. See https://caniuse.com/mdn-api_worker_worker_ecmascript_modules
50-
#endif
51-
#if MIN_SAFARI_VERSION < 150000
52-
#error new Worker() supports ECMAScript module only starting from Safari 15. Pass -sMIN_SAFARI_VERSION=150000 to target -sEXPORT_ES6 with -pthread. See https://caniuse.com/mdn-api_worker_worker_ecmascript_modules
53-
#endif
5448
'type': 'module',
5549
#endif
5650
#if ENVIRONMENT_MAY_BE_NODE

src/lib/libwasm_worker.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
#if WASM2JS && MODULARIZE
2525
#error "-sWASM=0 + -sMODULARIZE + -sWASM_WORKERS is not supported"
2626
#endif
27+
#if EXPORT_ES6 && (MIN_FIREFOX_VERSION < 114 || MIN_CHROME_VERSION < 80 || MIN_SAFARI_VERSION < 150000)
28+
#error "internal error, feature_matrix should not allow this"
29+
#endif
2730

2831
{{{
2932
const workerSupportsFutexWait = () => AUDIO_WORKLET ? "!ENVIRONMENT_IS_AUDIO_WORKLET" : '1';
@@ -40,15 +43,6 @@
4043
`;
4144
const wasmWorkerOptions = `{
4245
#if EXPORT_ES6
43-
#if MIN_FIREFOX_VERSION < 114
44-
#error new Worker() supports ECMAScript module only starting from Firefox 114. Pass -sMIN_FIREFOX_VERSION=114 to target -sEXPORT_ES6 with -sWASM_WORKERS. See https://caniuse.com/mdn-api_worker_worker_ecmascript_modules
45-
#endif
46-
#if MIN_CHROME_VERSION < 80
47-
#error new Worker() supports ECMAScript module only starting from Chrome 80. Pass -sMIN_CHROME_VERSION=80 to target -sEXPORT_ES6 with -sWASM_WORKERS. See https://caniuse.com/mdn-api_worker_worker_ecmascript_modules
48-
#endif
49-
#if MIN_SAFARI_VERSION < 150000
50-
#error new Worker() supports ECMAScript module only starting from Safari 15. Pass -sMIN_SAFARI_VERSION=150000 to target -sEXPORT_ES6 with -sWASM_WORKERS. See https://caniuse.com/mdn-api_worker_worker_ecmascript_modules
51-
#endif
5246
'type': 'module',
5347
#endif
5448
#if ENVIRONMENT_MAY_BE_NODE

0 commit comments

Comments
 (0)