Skip to content

Commit

Permalink
Remove ASMJS_CODE_FILE internal setting. NFC.
Browse files Browse the repository at this point in the history
See: #11860
  • Loading branch information
sbc100 committed Sep 10, 2020
1 parent ac48964 commit 7fd73f3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
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

0 comments on commit 7fd73f3

Please sign in to comment.