diff --git a/emcc.py b/emcc.py index 564a10468b747..e82f0860e6206 100644 --- a/emcc.py +++ b/emcc.py @@ -1853,6 +1853,16 @@ def phase_linker_setup(options, state, newargs): # Ignore -sMODULARIZE which could otherwise effect how we run the module # to generate the bindings. settings.MODULARIZE = False + # Don't include any custom user JS or files. + options.pre_js = [] + options.post_js = [] + options.extern_pre_js = [] + options.extern_post_js = [] + options.use_preload_cache = False + options.preload_files = [] + options.embed_files = [] + # Force node since that is where the tool runs. + settings.ENVIRONMENT = 'node' # options.output_file is the user-specified one, target is what we will generate if options.output_file: diff --git a/test/test_other.py b/test/test_other.py index d53f6c523e208..a54d8640e0c46 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -2919,13 +2919,22 @@ def test_jspi_add_function(self): self.do_runf(test_file('other/test_jspi_add_function.c'), 'done') def test_embind_tsgen(self): + create_file('fail.js', 'assert(false);') # These extra arguments are not related to TS binding generation but we want to # verify that they do not interfere with it. extra_args = ['-o', 'out.html', '-sMODULARIZE', '-sALLOW_MEMORY_GROWTH=1', - '-sMAXIMUM_MEMORY=4GB'] + '-sMAXIMUM_MEMORY=4GB', + '--pre-js', 'fail.js', + '--post-js', 'fail.js', + '--extern-pre-js', 'fail.js', + '--extern-post-js', 'fail.js', + '-sENVIRONMENT=worker', + '--use-preload-cache', + '--preload-file', 'fail.js', + '--embed-file', 'fail.js'] self.run_process([EMCC, test_file('other/embind_tsgen.cpp'), '-lembind', '--embind-emit-tsd', 'embind_tsgen.d.ts'] + extra_args) actual = read_file('embind_tsgen.d.ts')