Skip to content

Commit 9f83e14

Browse files
authored
Move TARGET_NOT_SUPPORTED to parseTools.js. NFC (#21540)
This is not a setting, its just a constant.
1 parent 201f876 commit 9f83e14

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/parseTools.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
globalThis.FOUR_GB = 4 * 1024 * 1024 * 1024;
1212
globalThis.WASM_PAGE_SIZE = 64 * 1024;
13+
// Represents a browser version that is not supported at all.
14+
globalThis.TARGET_NOT_SUPPORTED = 0x7FFFFFFF;
1315

1416
const FLOAT_TYPES = new Set(['float', 'double']);
1517

src/settings_internal.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ var MINIFY_WASM_IMPORTED_MODULES = false;
164164
// Whether to minify exports from the Wasm module.
165165
var MINIFY_WASM_EXPORT_NAMES = true;
166166

167-
// Internal: represents a browser version that is not supported at all.
168-
var TARGET_NOT_SUPPORTED = 0x7FFFFFFF;
169-
170167
// Used to track whether target environment supports the 'globalThis' attribute.
171168
var SUPPORTS_GLOBALTHIS = false;
172169

tools/minimal_runtime_shell.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from . import shared
1111
from . import line_endings
1212
from . import utils
13+
from . import feature_matrix
1314
from .settings import settings
1415

1516
logger = logging.getLogger('minimal_runtime_shell')
@@ -23,7 +24,7 @@ def generate_minimal_runtime_load_statement(target_basename):
2324
# Depending on whether streaming Wasm compilation is enabled or not, the minimal sized code to download Wasm looks a bit different.
2425
# Expand {{{ DOWNLOAD_WASM }}} block from here (if we added #define support, this could be done in the template directly)
2526
if settings.MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION:
26-
if settings.MIN_SAFARI_VERSION != settings.TARGET_NOT_SUPPORTED or settings.ENVIRONMENT_MAY_BE_NODE or settings.MIN_FIREFOX_VERSION < 58 or settings.MIN_CHROME_VERSION < 61:
27+
if settings.MIN_SAFARI_VERSION != feature_matrix.UNSUPPORTED or settings.ENVIRONMENT_MAY_BE_NODE or settings.MIN_FIREFOX_VERSION < 58 or settings.MIN_CHROME_VERSION < 61:
2728
# Firefox 52 added Wasm support, but only Firefox 58 added compileStreaming.
2829
# Chrome 57 added Wasm support, but only Chrome 61 added compileStreaming.
2930
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming
@@ -34,7 +35,7 @@ def generate_minimal_runtime_load_statement(target_basename):
3435
download_wasm = "WebAssembly.compileStreaming(fetch('%s'))" % (target_basename + '.wasm')
3536
elif settings.MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION:
3637
# Same compatibility story as above for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming
37-
if settings.MIN_SAFARI_VERSION != settings.TARGET_NOT_SUPPORTED or settings.ENVIRONMENT_MAY_BE_NODE or settings.MIN_FIREFOX_VERSION < 58 or settings.MIN_CHROME_VERSION < 61:
38+
if settings.MIN_SAFARI_VERSION != feature_matrix.UNSUPPORTED or settings.ENVIRONMENT_MAY_BE_NODE or settings.MIN_FIREFOX_VERSION < 58 or settings.MIN_CHROME_VERSION < 61:
3839
download_wasm = "!WebAssembly.instantiateStreaming && binary('%s')" % (target_basename + '.wasm')
3940
else:
4041
# WebAssembly.instantiateStreaming() is unconditionally supported, so we do not download wasm in the .html file,

0 commit comments

Comments
 (0)