Skip to content

Commit 21ba259

Browse files
authored
[tsgen] Ignore source map when generating TS definitions. (#22781)
Fixes #22768
1 parent caa5c62 commit 21ba259

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

test/test_other.py

+5
Original file line numberDiff line numberDiff line change
@@ -3372,6 +3372,11 @@ def test_embind_tsgen_ignore(self):
33723372
self.emcc(test_file('other/embind_tsgen.cpp'), extra_args)
33733373
self.assertFileContents(test_file('other/embind_tsgen_ignore_3.d.ts'), read_file('embind_tsgen.d.ts'))
33743374

3375+
extra_args = ['-fsanitize=undefined',
3376+
'-gsource-map']
3377+
self.emcc(test_file('other/embind_tsgen.cpp'), extra_args)
3378+
self.assertFileContents(test_file('other/embind_tsgen_ignore_3.d.ts'), read_file('embind_tsgen.d.ts'))
3379+
33753380
def test_embind_tsgen_worker_env(self):
33763381
self.emcc_args += ['-lembind', '--emit-tsd', 'embind_tsgen.d.ts']
33773382
# Passing -sWASM_WORKERS or -sPROXY_TO_WORKER requires the 'worker' environment

tools/link.py

+2
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,8 @@ def run_embind_gen(wasm_target, js_syms, extra_settings, linker_inputs):
19851985
settings.JS_LIBRARIES[embind_index] = 'embind/embind_gen.js'
19861986
if settings.MEMORY64:
19871987
settings.MIN_NODE_VERSION = 160000
1988+
# Source maps haven't been generated yet and aren't needed to run embind_gen.
1989+
settings.LOAD_SOURCE_MAP = 0
19881990
outfile_js = in_temp('tsgen.js')
19891991
# The Wasm outfile may be modified by emscripten.emscript, so use a temporary file.
19901992
outfile_wasm = in_temp('tsgen.wasm')

0 commit comments

Comments
 (0)