Skip to content
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

[tsgen] Ignore source map when generating TS definitions. #22781

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -3372,6 +3372,11 @@ def test_embind_tsgen_ignore(self):
self.emcc(test_file('other/embind_tsgen.cpp'), extra_args)
self.assertFileContents(test_file('other/embind_tsgen_ignore_3.d.ts'), read_file('embind_tsgen.d.ts'))

extra_args = ['-fsanitize=undefined',
'-gsource-map']
self.emcc(test_file('other/embind_tsgen.cpp'), extra_args)
self.assertFileContents(test_file('other/embind_tsgen_ignore_3.d.ts'), read_file('embind_tsgen.d.ts'))

def test_embind_tsgen_worker_env(self):
self.emcc_args += ['-lembind', '--emit-tsd', 'embind_tsgen.d.ts']
# Passing -sWASM_WORKERS or -sPROXY_TO_WORKER requires the 'worker' environment
Expand Down
2 changes: 2 additions & 0 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,8 @@ def run_embind_gen(wasm_target, js_syms, extra_settings, linker_inputs):
settings.JS_LIBRARIES[embind_index] = 'embind/embind_gen.js'
if settings.MEMORY64:
settings.MIN_NODE_VERSION = 160000
# Source maps haven't been generated yet and aren't needed to run embind_gen.
settings.LOAD_SOURCE_MAP = 0
outfile_js = in_temp('tsgen.js')
# The Wasm outfile may be modified by emscripten.emscript, so use a temporary file.
outfile_wasm = in_temp('tsgen.wasm')
Expand Down
Loading