Commit 38c32fa
committed
Revert #6: keep global hierarchy module-local
Hoisting _globalHierarchy onto globalThis[Symbol.for(…)] was
over-defensive. The playground bug we used as precedent was fixed by
unifying URLs, not by papering over duplicate loads with shared
state. Normal ESM semantics — one module instance per realm per URL —
is the correct behavior, and every other module-level state in squint
(including core.js's _metaSym) lives that way. cljs.core's
*global-hierarchy* is module-scoped for the same reason.
A user who ends up with two instances of multi.js under different
URLs almost certainly has two versions of squint in their graph;
sharing state across versions via globalThis would hide real
version-mismatch bugs instead of surfacing them.
Move #6 from Done to Wontfix in todo.md with the reasoning.1 parent 71309b4 commit 38c32fa
2 files changed
Lines changed: 16 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 22 | + | |
28 | 23 | | |
29 | | - | |
| 24 | + | |
30 | 25 | | |
31 | | - | |
32 | 26 | | |
33 | 27 | | |
34 | 28 | | |
| |||
89 | 83 | | |
90 | 84 | | |
91 | 85 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 86 | + | |
| 87 | + | |
95 | 88 | | |
96 | 89 | | |
97 | 90 | | |
| |||
122 | 115 | | |
123 | 116 | | |
124 | 117 | | |
125 | | - | |
| 118 | + | |
126 | 119 | | |
127 | 120 | | |
128 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
0 commit comments