Skip to content

Commit c2627fd

Browse files
committed
fix checking of BIGINT against explicit version
1 parent faa22bb commit c2627fd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tools/feature_matrix.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ def enable_feature(feature, reason, override=False):
128128
"""
129129
if override:
130130
enable_override_features.add(feature)
131+
if check_feature(feature, reason):
132+
# If no conflict, bump the minimum version to accommodate the feature.
133+
setattr(settings, name, min_version)
134+
135+
def check_feature(feature, reason):
131136
for name, min_version in min_browser_versions[feature].items():
132137
name = f'MIN_{name.upper()}_VERSION'
133138
if settings[name] < min_version:
@@ -137,9 +142,10 @@ def enable_feature(feature, reason, override=False):
137142
'compatibility',
138143
f'{name}={user_settings[name]} is not compatible with {reason} '
139144
f'({min_version} or above required)')
145+
return False
140146
else:
141-
# Otherwise we bump the minimum version to accommodate the feature.
142-
setattr(settings, name, min_version)
147+
return True
148+
143149

144150

145151
def disable_feature(feature):
@@ -152,6 +158,9 @@ def disable_feature(feature):
152158
# a user requests a feature that we know is only supported in browsers
153159
# from a specific version and above, we can assume that browser version.
154160
def apply_min_browser_versions():
161+
if settings.WASM_BIGINT:
162+
# WASM_BIGINT is enabled by default, so don't use it to enable other features.
163+
check_feature(Feature.JS_BIGINT_INTEGRATION, 'WASM_BIGINT')
155164
if settings.PTHREADS:
156165
enable_feature(Feature.THREADS, 'pthreads')
157166
enable_feature(Feature.BULK_MEMORY, 'pthreads')

0 commit comments

Comments
 (0)