Skip to content
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
1 change: 1 addition & 0 deletions test/other/test_emit_tsd.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// TypeScript bindings for emscripten-generated code. Automatically generated at compile time.
declare namespace RuntimeExports {
let POINTER_SIZE: number;
/**
* Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
* array that contains uint8 values, returns a copy of that string as a
Expand Down
1 change: 1 addition & 0 deletions test/other/test_emit_tsd_jspi.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// TypeScript bindings for emscripten-generated code. Automatically generated at compile time.
declare namespace RuntimeExports {
let POINTER_SIZE: number;
/**
* Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
* array that contains uint8 values, returns a copy of that string as a
Expand Down
1 change: 1 addition & 0 deletions test/other/test_tsd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ async function go() {
module._fooVoid();
let result = module._fooInt(7, 8);
module.UTF8ArrayToString([], 99);
module.POINTER_SIZE;
}
2 changes: 1 addition & 1 deletion test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -3825,7 +3825,7 @@ def test_emit_tsd(self, args, postfix):
self.require_jspi()
self.run_process([EMCC, test_file('other/test_emit_tsd.c'),
'--emit-tsd', f'test_emit_tsd{postfix}.d.ts', '-sEXPORT_ES6',
'-sMODULARIZE', '-sEXPORTED_RUNTIME_METHODS=UTF8ArrayToString,wasmTable',
'-sMODULARIZE', '-sEXPORTED_RUNTIME_METHODS=POINTER_SIZE,UTF8ArrayToString,wasmTable',
'-o', f'test_emit_tsd{postfix}.js'] + args +
self.get_cflags())
self.assertFilesMatch(test_file(f'other/test_emit_tsd{postfix}.d.ts'), f'test_emit_tsd{postfix}.d.ts')
Expand Down
2 changes: 1 addition & 1 deletion tools/emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def create_tsd_exported_runtime_methods(metadata):
if name in metadata.library_definitions:
definition = metadata.library_definitions[name]
if definition['snippet']:
snippet = ' = ' + definition['snippet']
snippet = f' = {definition["snippet"]}'
# Clear the doc so the type is either computed from the snippet or
# defined by the definition below.
docs = ''
Expand Down