mdedit's toc.js exported updateToc / clearActiveTocItem / setActiveTocItem as window.* globals, which was the only remaining violation of the two-globals discipline (only window.app and window.zddc are intended). Other tools either use IIFE + window.app.modules.X, or — like mdedit — declare top-level functions that are reachable across concatenated files without going through window. Removed the three window.* exports and unqualified the four call sites in events.js, editor.js (×3), and file-system.js. setActiveTocItem was already called bare elsewhere; the change is just dropping a window.foo && check chain that's now unnecessary. No behavior change — TOC generation and click-to-scroll work as before. mdedit's three Playwright tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app.js | ||
| editor.js | ||
| events.js | ||
| file-ops.js | ||
| file-system.js | ||
| file-tree.js | ||
| front-matter.js | ||
| main.js | ||
| resizer.js | ||
| toc.js | ||
| utils.js | ||