Skip to content

Rename internal MINIFY_ASMJS_EXPORT_NAMES setting. NFC #18893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2491,7 +2491,7 @@ def check_memory_setting(setting):
# wasm module export names so that the names can be passed directly to the outer scope.
# Also, if using library_exports.js API, disable minification so that the feature can work.
if not settings.DECLARE_ASM_MODULE_EXPORTS or '-lexports.js' in [x for _, x in state.link_flags]:
settings.MINIFY_ASMJS_EXPORT_NAMES = 0
settings.MINIFY_WASM_EXPORT_NAMES = 0

if '-lembind' in [x for _, x in state.link_flags]:
settings.EMBIND = 1
Expand All @@ -2513,7 +2513,7 @@ def check_memory_setting(setting):
not settings.ASSERTIONS and \
not settings.RELOCATABLE and \
not settings.ASYNCIFY_LAZY_LOAD_CODE and \
settings.MINIFY_ASMJS_EXPORT_NAMES:
settings.MINIFY_WASM_EXPORT_NAMES:
settings.MINIFY_WASM_IMPORTS_AND_EXPORTS = 1
settings.MINIFY_WASM_IMPORTED_MODULES = 1

Expand Down
4 changes: 2 additions & 2 deletions src/settings_internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ var MINIFY_WASM_IMPORTS_AND_EXPORTS = false;
// Whether to minify imported module names.
var MINIFY_WASM_IMPORTED_MODULES = false;

// Whether to minify functions exported from Asm.js/Wasm module.
var MINIFY_ASMJS_EXPORT_NAMES = true;
// Whether to minify exports from the Wasm module.
var MINIFY_WASM_EXPORT_NAMES = true;

// Internal: represents a browser version that is not supported at all.
var TARGET_NOT_SUPPORTED = 0x7FFFFFFF;
Expand Down
5 changes: 4 additions & 1 deletion tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,10 @@ def minify_wasm_js(js_file, wasm_file, expensive_optimizations, minify_whitespac
logger.debug('running post-meta-DCE cleanup on shell code: ' + ' '.join(passes))
js_file = acorn_optimizer(js_file, passes)
if settings.MINIFY_WASM_IMPORTS_AND_EXPORTS:
js_file = minify_wasm_imports_and_exports(js_file, wasm_file, minify_whitespace=minify_whitespace, minify_exports=settings.MINIFY_ASMJS_EXPORT_NAMES, debug_info=debug_info)
js_file = minify_wasm_imports_and_exports(js_file, wasm_file,
minify_whitespace=minify_whitespace,
minify_exports=settings.MINIFY_WASM_EXPORT_NAMES,
debug_info=debug_info)
return js_file


Expand Down