3737from .minimal_runtime_shell import generate_minimal_runtime_html
3838from .settings import (
3939 DEPRECATED_SETTINGS ,
40+ EXPERIMENTAL_SETTINGS ,
4041 INCOMPATIBLE_SETTINGS ,
4142 JS_ONLY_SETTINGS ,
4243 default_setting ,
@@ -664,7 +665,11 @@ def add_system_js_lib(lib):
664665 settings .JS_LIBRARIES .append (lib )
665666
666667
667- def report_incompatible_settings ():
668+ def check_settings ():
669+ for name , msg in EXPERIMENTAL_SETTINGS .items ():
670+ if getattr (settings , name ):
671+ diagnostics .warning ('experimental' , msg )
672+
668673 for a , b , reason in INCOMPATIBLE_SETTINGS :
669674 invert_b = b .startswith ('NO_' )
670675 if invert_b :
@@ -826,19 +831,10 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
826831
827832 settings .OUTPUT_FORMAT = options .oformat .name
828833
829- if settings .JS_BASE64_API :
830- diagnostics .warning ('experimental' , '-sJS_BASE64_API is still experimental and not yet supported in browsers' )
831-
832- if settings .GROWABLE_ARRAYBUFFERS :
833- diagnostics .warning ('experimental' , '-sGROWABLE_ARRAYBUFFERS is still experimental and not yet supported in browsers' )
834-
835- if settings .SUPPORT_BIG_ENDIAN :
836- diagnostics .warning ('experimental' , '-sSUPPORT_BIG_ENDIAN is experimental, not all features are fully supported.' )
837- if settings .WASM2JS :
838- exit_with_error ('WASMJ2S is currently not compatible with SUPPORT_BIG_ENDIAN' )
834+ if settings .SUPPORT_BIG_ENDIAN and settings .WASM2JS :
835+ exit_with_error ('WASMJ2S is currently not compatible with SUPPORT_BIG_ENDIAN' )
839836
840837 if settings .WASM_ESM_INTEGRATION :
841- diagnostics .warning ('experimental' , '-sWASM_ESM_INTEGRATION is still experimental and not yet supported in browsers' )
842838 default_setting ('MODULARIZE' , 'instance' )
843839 if not settings .EXPORT_ES6 :
844840 exit_with_error ('WASM_ESM_INTEGRATION requires EXPORT_ES6' )
@@ -857,9 +853,6 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
857853 if settings .ABORT_ON_WASM_EXCEPTIONS :
858854 exit_with_error ('WASM_ESM_INTEGRATION is not compatible with ABORT_ON_WASM_EXCEPTIONS' )
859855
860- if settings .WASM_JS_TYPES :
861- diagnostics .warning ('experimental' , '-sWASM_JS_TYPES is only supported under a flag in certain browsers' )
862-
863856 if settings .MODULARIZE and settings .MODULARIZE not in [1 , 'instance' ]:
864857 exit_with_error (f'Invalid setting "{ settings .MODULARIZE } " for MODULARIZE.' )
865858
@@ -1770,9 +1763,6 @@ def get_full_import_name(name):
17701763 if settings .ASYNCIFY == 2 :
17711764 diagnostics .warning ('experimental' , '-sASYNCIFY=2 (JSPI) is still experimental' )
17721765
1773- if settings .SOURCE_PHASE_IMPORTS :
1774- diagnostics .warning ('experimental' , '-sSOURCE_PHASE_IMPORTS is still experimental and not yet supported in browsers' )
1775-
17761766 if settings .WASM2JS :
17771767 if settings .GENERATE_SOURCE_MAP :
17781768 exit_with_error ('wasm2js does not support source maps yet (debug in wasm for now)' )
@@ -1875,7 +1865,7 @@ def get_full_import_name(name):
18751865 if settings .USE_CLOSURE_COMPILER or not settings .MINIFY_WHITESPACE :
18761866 settings .MAYBE_CLOSURE_COMPILER = 1
18771867
1878- report_incompatible_settings ()
1868+ check_settings ()
18791869
18801870 return target , wasm_target
18811871
@@ -2249,7 +2239,6 @@ def phase_final_emitting(options, target, js_target, wasm_target):
22492239 generate_worker_js (target , options , js_target , target_basename )
22502240
22512241 if settings .SPLIT_MODULE :
2252- diagnostics .warning ('experimental' , 'the SPLIT_MODULE setting is experimental and subject to change' )
22532242 do_split_module (wasm_target , options )
22542243
22552244 if options .executable :
0 commit comments