(js)
| 46 | |
| 47 | |
| 48 | def 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 | |
| 65 | class Minifier: |
no test coverage detected