Skip to content

Commit 0483145

Browse files
committed
[embind] Always enable assertions during TypeScript generation.
Fixes #21641
1 parent 249becf commit 0483145

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/test_other.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3192,7 +3192,9 @@ def test_embind_tsgen_ignore(self):
31923192
extra_args = ['-sMODULARIZE',
31933193
'--embed-file', 'fail.js',
31943194
'-sMINIMAL_RUNTIME=2',
3195-
'-sEXPORT_ES6=1']
3195+
'-sEXPORT_ES6=1',
3196+
'-sASSERTIONS=0',
3197+
'-sSTRICT=1']
31963198
self.emcc(test_file('other/embind_tsgen.cpp'), extra_args)
31973199
self.assertFileContents(test_file('other/embind_tsgen_ignore_2.d.ts'), read_file('embind_tsgen.d.ts'))
31983200
# Also test this separately since it conflicts with other settings.

tools/link.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,6 +1962,8 @@ def run_embind_gen(wasm_target, js_syms, extra_settings):
19621962
settings.SINGLE_FILE = False
19631963
# Embind may be included multiple times, de-duplicate the list first.
19641964
settings.JS_LIBRARIES = dedup_list(settings.JS_LIBRARIES)
1965+
# Assertions are always used.
1966+
settings.ASSERTIONS = 1
19651967
# Replace embind with the TypeScript generation version.
19661968
embind_index = settings.JS_LIBRARIES.index('embind/embind.js')
19671969
settings.JS_LIBRARIES[embind_index] = 'embind/embind_gen.js'

0 commit comments

Comments
 (0)