MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / asmjs_mangle

Function asmjs_mangle

tools/shared.py:591–603  ·  view source on GitHub ↗

Mangle a name the way asm.js/JSBackend globals are mangled. Prepends '_' and replaces non-alphanumerics with '_'. Used by wasm backend for JS library consistency with asm.js.

(name)

Source from the content-addressed store, hash-verified

589
590
591def asmjs_mangle(name):
592 """Mangle a name the way asm.js/JSBackend globals are mangled.
593
594 Prepends '_' and replaces non-alphanumerics with '_'.
595 Used by wasm backend for JS library consistency with asm.js.
596 """
597 # We also use this function to convert the clang-mangled `__main_argc_argv`
598 # to simply `main` which is expected by the emscripten JS glue code.
599 if name == '__main_argc_argv':
600 name = 'main'
601 if is_user_export(name):
602 return '_' + name
603 return name
604
605
606def do_replace(input_, pattern, replacement):

Callers 8

report_missing_exportsFunction · 0.90
finalize_wasmFunction · 0.90
create_tsdFunction · 0.90
create_sendingFunction · 0.90
create_receivingFunction · 0.90
closure_compilerFunction · 0.85
metadceFunction · 0.85

Calls 1

is_user_exportFunction · 0.85

Tested by

no test coverage detected