Skip to content

Remove ASMJS_CODE_FILE internal setting. NFC. #12158

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
Sep 11, 2020
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
17 changes: 2 additions & 15 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1677,12 +1677,10 @@ def include_and_export(name):
# placeholder strings for JS glue, to be replaced with subresource locations in do_binaryen
shared.Settings.WASM_TEXT_FILE = shared.FilenameReplacementStrings.WASM_TEXT_FILE
shared.Settings.WASM_BINARY_FILE = shared.FilenameReplacementStrings.WASM_BINARY_FILE
shared.Settings.ASMJS_CODE_FILE = shared.FilenameReplacementStrings.ASMJS_CODE_FILE
else:
# set file locations, so that JS glue can find what it needs
shared.Settings.WASM_TEXT_FILE = shared.JS.escape_for_js_string(os.path.basename(wasm_text_target))
shared.Settings.WASM_BINARY_FILE = shared.JS.escape_for_js_string(os.path.basename(wasm_binary_target))
shared.Settings.ASMJS_CODE_FILE = shared.JS.escape_for_js_string(os.path.basename(asm_target))
if options.use_closure_compiler == 2 and not shared.Settings.WASM2JS:
exit_with_error('closure compiler mode 2 assumes the code is asm.js, so not meaningful for wasm')
if any(s.startswith('MEM_INIT_METHOD=') for s in settings_changes):
Expand Down Expand Up @@ -2753,19 +2751,8 @@ def run_closure_compiler(final):
if '{{{ WASM_BINARY_DATA }}}' in js:
js = js.replace('{{{ WASM_BINARY_DATA }}}', base64_encode(open(wasm_binary_target, 'rb').read()))

for target, replacement_string, should_embed in (
(wasm_binary_target,
shared.FilenameReplacementStrings.WASM_BINARY_FILE,
True),
(asm_target,
shared.FilenameReplacementStrings.ASMJS_CODE_FILE,
False),
):
if should_embed and os.path.isfile(target):
js = js.replace(replacement_string, shared.JS.get_subresource_location(target))
else:
js = js.replace(replacement_string, '')
shared.try_delete(target)
js = js.replace(shared.FilenameReplacementStrings.WASM_BINARY_FILE, shared.JS.get_subresource_location(wasm_binary_target))
shared.try_delete(wasm_binary_target)
with open(final, 'w') as f:
f.write(js)

Expand Down
3 changes: 0 additions & 3 deletions src/settings_internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ var WASM_TEXT_FILE = '';
// name of the file containing wasm binary, if relevant
var WASM_BINARY_FILE = '';

// name of the file containing asm.js code, if relevant
var ASMJS_CODE_FILE = '';

// name of the file containing the pthread *.worker.js, if relevant
var PTHREAD_WORKER_FILE = '';

Expand Down
1 change: 0 additions & 1 deletion tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,6 @@ def reconfigure_cache():
class FilenameReplacementStrings:
WASM_TEXT_FILE = '{{{ FILENAME_REPLACEMENT_STRINGS_WASM_TEXT_FILE }}}'
WASM_BINARY_FILE = '{{{ FILENAME_REPLACEMENT_STRINGS_WASM_BINARY_FILE }}}'
ASMJS_CODE_FILE = '{{{ FILENAME_REPLACEMENT_STRINGS_ASMJS_CODE_FILE }}}'


class JS(object):
Expand Down