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

Function split_funcs

tools/js_optimizer.py:48–62  ·  view source on GitHub ↗
(js)

Source from the content-addressed store, hash-verified

46
47
48def split_funcs(js):
49 # split properly even if there are no newlines,
50 # which is important for deterministic builds (as which functions
51 # are in each chunk may differ, so we need to split them up and combine
52 # them all together later and sort them deterministically)
53 parts = ['function ' + part for part in js.split('function ')[1:]]
54 funcs = []
55 for func in parts:
56 m = func_sig.search(func)
57 if not m:
58 continue
59 ident = m.group(1)
60 assert ident
61 funcs.append((ident, func))
62 return funcs
63
64
65class Minifier:

Callers 1

run_on_fileFunction · 0.85

Calls 2

splitMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected