10
10
from . import shared
11
11
from . import line_endings
12
12
from . import utils
13
+ from . import feature_matrix
13
14
from .settings import settings
14
15
15
16
logger = logging .getLogger ('minimal_runtime_shell' )
@@ -23,7 +24,7 @@ def generate_minimal_runtime_load_statement(target_basename):
23
24
# Depending on whether streaming Wasm compilation is enabled or not, the minimal sized code to download Wasm looks a bit different.
24
25
# Expand {{{ DOWNLOAD_WASM }}} block from here (if we added #define support, this could be done in the template directly)
25
26
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 :
27
28
# Firefox 52 added Wasm support, but only Firefox 58 added compileStreaming.
28
29
# Chrome 57 added Wasm support, but only Chrome 61 added compileStreaming.
29
30
# 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):
34
35
download_wasm = "WebAssembly.compileStreaming(fetch('%s'))" % (target_basename + '.wasm' )
35
36
elif settings .MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION :
36
37
# 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 :
38
39
download_wasm = "!WebAssembly.instantiateStreaming && binary('%s')" % (target_basename + '.wasm' )
39
40
else :
40
41
# WebAssembly.instantiateStreaming() is unconditionally supported, so we do not download wasm in the .html file,
0 commit comments